dsh-desktop-kit 2.24.1 → 2.30.0

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 (71) hide show
  1. package/CHANGELOG.md +71 -10
  2. package/README.md +193 -262
  3. package/client.js +1 -1
  4. package/docs/ARCHITECTURE.md +9 -6
  5. package/docs/PROPOSAL-2.25-quality-pipeline.md +435 -0
  6. package/docs/PROPOSAL-NEXUM-FINDINGS.md +259 -0
  7. package/docs/TEST-2.30.0.md +83 -0
  8. package/docs/images/capability-map-2.30.png +0 -0
  9. package/docs/images/hero-2.30.png +0 -0
  10. package/docs/images/quality-pipeline-2.30.png +0 -0
  11. package/docs/preview/capability-map-2.30.html +106 -0
  12. package/docs/preview/hero-2.30.html +133 -0
  13. package/docs/preview/quality-pipeline-2.30.html +142 -0
  14. package/docs/preview/readme-visuals.css +111 -0
  15. package/index.js +6 -0
  16. package/package.json +11 -4
  17. package/plugins/dsh-agent-extensions/lib/routing.js +4 -0
  18. package/plugins/dsh-agent-extensions/lib/scaffold.js +152 -27
  19. package/plugins/dsh-agent-extensions/lib/settings.js +19 -0
  20. package/plugins/dsh-agent-extensions/lib/swarm.js +6 -2
  21. package/plugins/dsh-browser-qa/index.js +202 -9
  22. package/plugins/dsh-browser-qa/lib/design-more.js +688 -0
  23. package/plugins/dsh-browser-qa/lib/extras.js +1313 -0
  24. package/plugins/dsh-browser-qa/lib/pages.js +4 -3
  25. package/plugins/dsh-browser-qa/lib/png.js +190 -0
  26. package/plugins/dsh-browser-qa/lib/ui-gate.js +171 -31
  27. package/plugins/dsh-i18n/README.md +36 -0
  28. package/plugins/dsh-i18n/cordis.patch.yml +3 -0
  29. package/plugins/dsh-i18n/index.js +294 -0
  30. package/plugins/dsh-i18n/lib/lang.js +179 -0
  31. package/plugins/dsh-i18n/package.json +29 -0
  32. package/plugins/dsh-quality-pipeline/README.md +53 -0
  33. package/plugins/dsh-quality-pipeline/cordis.patch.yml +3 -0
  34. package/plugins/dsh-quality-pipeline/index.js +647 -0
  35. package/plugins/dsh-quality-pipeline/lib/acceptance.js +132 -0
  36. package/plugins/dsh-quality-pipeline/lib/autostart.js +159 -0
  37. package/plugins/dsh-quality-pipeline/lib/design.js +123 -0
  38. package/plugins/dsh-quality-pipeline/lib/machine.js +312 -0
  39. package/plugins/dsh-quality-pipeline/lib/prework.js +215 -0
  40. package/plugins/dsh-quality-pipeline/lib/release.js +53 -0
  41. package/plugins/dsh-quality-pipeline/lib/schema.js +256 -0
  42. package/plugins/dsh-quality-pipeline/lib/store.js +114 -0
  43. package/plugins/dsh-quality-pipeline/lib/text.js +109 -0
  44. package/plugins/dsh-quality-pipeline/package.json +33 -0
  45. package/plugins/dsh-remote-ops/README.md +38 -0
  46. package/plugins/dsh-remote-ops/cordis.patch.yml +3 -0
  47. package/plugins/dsh-remote-ops/index.js +268 -0
  48. package/plugins/dsh-remote-ops/lib/hosts.js +118 -0
  49. package/plugins/dsh-remote-ops/lib/ssh.js +96 -0
  50. package/plugins/dsh-remote-ops/lib/state.js +66 -0
  51. package/plugins/dsh-remote-ops/package.json +31 -0
  52. package/plugins/dsh-skill-autopilot/index.js +204 -15
  53. package/skills/a11y-audit/SKILL.md +67 -0
  54. package/skills/cms-ops/SKILL.md +74 -0
  55. package/skills/design-system/SKILL.md +100 -0
  56. package/skills/legal-ru-web/SKILL.md +68 -0
  57. package/skills/manifest.json +38 -18
  58. package/skills/release-pipeline/SKILL.md +67 -0
  59. package/skills/ui-batch/SKILL.md +60 -0
  60. package/skills/web-build/SKILL.md +106 -0
  61. package/skills/web-build/recipes/form.md +16 -0
  62. package/skills/web-build/recipes/payment.md +16 -0
  63. package/skills/web-build/recipes/review.md +16 -0
  64. package/skills-baseline.json +192 -0
  65. package/skills/ui-design-system/references/accessibility-and-responsive.md +0 -50
  66. package/skills/ui-design-system/references/tokens-and-components.md +0 -67
  67. package/skills/ui-design-system/references/visual-qa.md +0 -44
  68. package/skills/visual-qa/references/commands.md +0 -32
  69. /package/skills/{ui-craft/SKILL.md → design-system/references/ui-craft.md} +0 -0
  70. /package/skills/{ui-design-system/SKILL.md → design-system/references/ui-design-system.md} +0 -0
  71. /package/skills/{visual-qa/SKILL.md → ui-batch/references/visual-qa.md} +0 -0
@@ -0,0 +1,132 @@
1
+ /**
2
+ * Acceptance runner: turns `mission.acceptance[]` into a real PASS/FAIL.
3
+ *
4
+ * Commands are split by a tiny tokenizer (no shell), executed with
5
+ * `child_process.execFile` inside the project cwd, and never through a shell
6
+ * string — so `; rm -rf`, pipes and substitutions in a command are inert.
7
+ */
8
+ import { execFile } from "node:child_process";
9
+
10
+ export const ACCEPTANCE_TIMEOUT_MS = 120_000;
11
+ const OUTPUT_LIMIT = 1600;
12
+
13
+ /** Split `node qa.mjs audit --url https://x` into argv, honouring quotes. */
14
+ export function splitCommand(command) {
15
+ const text = String(command ?? "").trim();
16
+ if (!text) return { ok: false, reason: "пустая команда", argv: [] };
17
+ const argv = [];
18
+ let current = "";
19
+ let quote = "";
20
+ let escaped = false;
21
+ for (const char of text) {
22
+ if (escaped) {
23
+ current += char;
24
+ escaped = false;
25
+ continue;
26
+ }
27
+ if (char === "\\" && quote !== "'") {
28
+ escaped = true;
29
+ continue;
30
+ }
31
+ if (quote) {
32
+ if (char === quote) quote = "";
33
+ else current += char;
34
+ continue;
35
+ }
36
+ if (char === '"' || char === "'") {
37
+ quote = char;
38
+ continue;
39
+ }
40
+ if (/\s/u.test(char)) {
41
+ if (current.length > 0) {
42
+ argv.push(current);
43
+ current = "";
44
+ }
45
+ continue;
46
+ }
47
+ if (char === ";" || char === "|" || char === "&" || char === ">" || char === "<" || char === "`" || char === "$") {
48
+ return { ok: false, reason: `запрещённый символ в команде: ${char} (shell не используется)`, argv: [] };
49
+ }
50
+ current += char;
51
+ }
52
+ if (quote) return { ok: false, reason: "незакрытая кавычка", argv: [] };
53
+ if (current.length > 0) argv.push(current);
54
+ if (argv.length === 0) return { ok: false, reason: "пустая команда", argv: [] };
55
+ return { ok: true, reason: "", argv };
56
+ }
57
+
58
+ function runOne(argv, cwd, timeoutMs) {
59
+ return new Promise((resolve) => {
60
+ const [command, ...args] = argv;
61
+ execFile(
62
+ command,
63
+ args,
64
+ { cwd, timeout: timeoutMs, windowsHide: true, maxBuffer: 4 * 1024 * 1024, shell: false },
65
+ (error, stdout, stderr) => {
66
+ const output = `${String(stdout ?? "")}${String(stderr ?? "")}`.trim();
67
+ if (error) {
68
+ const code = typeof error.code === "number" ? error.code : error.code ?? "error";
69
+ resolve({ ok: false, code, output: output.slice(-OUTPUT_LIMIT) || String(error.message ?? "").slice(0, OUTPUT_LIMIT) });
70
+ return;
71
+ }
72
+ resolve({ ok: true, code: 0, output: output.slice(-OUTPUT_LIMIT) });
73
+ },
74
+ );
75
+ });
76
+ }
77
+
78
+ /**
79
+ * Run acceptance checks. `only` limits the run to the listed ids.
80
+ * Mutates nothing — returns rows; the caller writes status into the mission.
81
+ */
82
+ export async function runAcceptance({ cwd, mission, only = [], timeoutMs = ACCEPTANCE_TIMEOUT_MS }) {
83
+ const items = Array.isArray(mission?.acceptance) ? mission.acceptance : [];
84
+ const wanted = new Set((only ?? []).map((id) => String(id).trim()).filter(Boolean));
85
+ const rows = [];
86
+ for (const item of items) {
87
+ if (wanted.size > 0 && !wanted.has(item.id)) continue;
88
+ if (!item.command) {
89
+ rows.push({ id: item.id, title: item.title, status: "skipped", output: "нет команды", code: "" });
90
+ continue;
91
+ }
92
+ const split = splitCommand(item.command);
93
+ if (!split.ok) {
94
+ rows.push({ id: item.id, title: item.title, status: "error", output: split.reason, code: "" });
95
+ continue;
96
+ }
97
+ const startedAt = Date.now();
98
+ const result = await runOne(split.argv, cwd, timeoutMs);
99
+ rows.push({
100
+ id: item.id,
101
+ title: item.title,
102
+ status: result.ok ? "pass" : "fail",
103
+ code: result.code,
104
+ ms: Date.now() - startedAt,
105
+ output: result.output,
106
+ });
107
+ }
108
+ return rows;
109
+ }
110
+
111
+ export function applyAcceptanceRows(mission, rows, at = new Date().toISOString()) {
112
+ const byId = new Map((mission?.acceptance ?? []).map((item) => [item.id, item]));
113
+ for (const row of rows) {
114
+ const item = byId.get(row.id);
115
+ if (!item) continue;
116
+ item.status = row.status;
117
+ item.output = String(row.output ?? "").slice(0, OUTPUT_LIMIT);
118
+ item.lastRunAt = at;
119
+ }
120
+ return mission;
121
+ }
122
+
123
+ export function formatAcceptance(rows) {
124
+ if (!rows || rows.length === 0) return "приёмка: в миссии нет проверок";
125
+ const passed = rows.filter((row) => row.status === "pass").length;
126
+ const lines = rows.map((row) => {
127
+ const mark = row.status === "pass" ? "PASS" : row.status === "skipped" ? "SKIP" : "FAIL";
128
+ const tail = row.output ? ` — ${row.output.split("\n").filter(Boolean).slice(-1)[0]?.slice(0, 120) ?? ""}` : "";
129
+ return `${mark} ${row.id} ${row.title}${tail}`;
130
+ });
131
+ return [`приёмка: ${passed}/${rows.length} PASS`, ...lines].join("\n");
132
+ }
@@ -0,0 +1,159 @@
1
+ /**
2
+ * Zero-config start: a web project gets its quality mission automatically.
3
+ *
4
+ * The kit is installed to be used, not to be configured. On the first session
5
+ * in a project that looks like a website, a mission is created with the kit's
6
+ * default profile and whatever acceptance checks can be derived from the
7
+ * repository (`npm test`, an existing `qa.mjs`). Nothing is created for a
8
+ * library, a backend service or the kit's own repository.
9
+ */
10
+ import fs from "node:fs";
11
+ import os from "node:os";
12
+ import path from "node:path";
13
+
14
+ import { createMission } from "./schema.js";
15
+ import { readMission, writeMission } from "./store.js";
16
+
17
+ const WEB_FILES = [
18
+ "wp-config.php",
19
+ "index.html",
20
+ "public/index.html",
21
+ "src/index.html",
22
+ "next.config.js",
23
+ "next.config.mjs",
24
+ "next.config.ts",
25
+ "nuxt.config.ts",
26
+ "astro.config.mjs",
27
+ "vite.config.js",
28
+ "vite.config.ts",
29
+ "gatsby-config.js",
30
+ ];
31
+
32
+ const WEB_DEPS = /^(?:react|react-dom|vue|svelte|@angular\/core|next|nuxt|astro|gatsby|solid-js|tailwindcss|vite|@sveltejs\/kit)$/u;
33
+ const SKIP_DIR_NAMES = new Set([".dsh", ".git", "node_modules"]);
34
+
35
+ function qualitySettings() {
36
+ try {
37
+ const home = process.env.DSH_HOME || path.join(os.homedir(), ".dsh");
38
+ const raw = JSON.parse(fs.readFileSync(path.join(home, "kit.settings.json"), "utf8"));
39
+ const quality = raw?.quality ?? {};
40
+ const profile = ["fast", "standard", "turnkey"].includes(String(quality.profile)) ? String(quality.profile) : "standard";
41
+ return { enabled: quality.enabled !== false, profile, autoStart: quality.autoStart !== false };
42
+ } catch {
43
+ return { enabled: true, profile: "standard", autoStart: true };
44
+ }
45
+ }
46
+
47
+ function readJson(file) {
48
+ try {
49
+ return JSON.parse(fs.readFileSync(file, "utf8"));
50
+ } catch {
51
+ return null;
52
+ }
53
+ }
54
+
55
+ /** True when the directory looks like a website rather than a library. */
56
+ export function looksWeb(cwd) {
57
+ if (typeof cwd !== "string" || cwd.length === 0) return false;
58
+ if (WEB_FILES.some((file) => fs.existsSync(path.join(cwd, file)))) return true;
59
+ const pkg = readJson(path.join(cwd, "package.json"));
60
+ if (pkg) {
61
+ const deps = { ...(pkg.dependencies ?? {}), ...(pkg.devDependencies ?? {}) };
62
+ if (Object.keys(deps).some((name) => WEB_DEPS.test(name))) return true;
63
+ }
64
+ const composer = readJson(path.join(cwd, "composer.json"));
65
+ if (composer) {
66
+ const text = JSON.stringify(composer);
67
+ if (/wordpress|wp-cli|roots\/|johnpbloch/u.test(text)) return true;
68
+ }
69
+ for (const entry of ["src/themes", "wp-content/themes", "themes", "pages", "app"]) {
70
+ if (fs.existsSync(path.join(cwd, entry))) {
71
+ try {
72
+ if (fs.statSync(path.join(cwd, entry)).isDirectory()) return true;
73
+ } catch {
74
+ /* ignore */
75
+ }
76
+ }
77
+ }
78
+ return false;
79
+ }
80
+
81
+ function packageManager(cwd) {
82
+ if (fs.existsSync(path.join(cwd, "pnpm-lock.yaml"))) return "pnpm";
83
+ if (fs.existsSync(path.join(cwd, "yarn.lock"))) return "yarn";
84
+ return "npm";
85
+ }
86
+
87
+ /**
88
+ * Acceptance checks that already exist in the repository. Only commands that
89
+ * are unambiguous are added: a test script and a local design-QA script.
90
+ */
91
+ export function autoAcceptance(cwd) {
92
+ const checks = [];
93
+ const pkg = readJson(path.join(cwd, "package.json"));
94
+ if (pkg?.scripts && typeof pkg.scripts.test === "string" && pkg.scripts.test.trim().length > 0) {
95
+ const runner = packageManager(cwd);
96
+ checks.push({
97
+ id: "a1",
98
+ title: `${runner} test`,
99
+ command: runner === "npm" ? "npm test" : `${runner} test`,
100
+ threshold: "exit code 0",
101
+ });
102
+ }
103
+ for (const candidate of ["ops/design-qa/qa.mjs", "qa.mjs", "tools/qa.mjs", "scripts/qa.mjs"]) {
104
+ if (fs.existsSync(path.join(cwd, candidate))) {
105
+ checks.push({
106
+ id: `a${checks.length + 1}`,
107
+ title: "design audit",
108
+ command: `node ${candidate} audit --matrix full`,
109
+ threshold: "overflow 0, serious 0",
110
+ });
111
+ break;
112
+ }
113
+ }
114
+ return checks;
115
+ }
116
+
117
+ function isSkippedRoot(cwd) {
118
+ let resolved;
119
+ try {
120
+ resolved = fs.realpathSync(cwd);
121
+ } catch {
122
+ return true;
123
+ }
124
+ const home = path.resolve(os.homedir());
125
+ if (resolved === home || resolved === path.parse(resolved).root) return true;
126
+ if (resolved.startsWith(path.join(home, ".dsh"))) return true;
127
+ if (SKIP_DIR_NAMES.has(path.basename(resolved))) return true;
128
+ const pkg = readJson(path.join(resolved, "package.json"));
129
+ if (pkg?.name === "dsh-desktop-kit") return true;
130
+ return false;
131
+ }
132
+
133
+ /**
134
+ * Create the mission if the kit is enabled, the project is a website and no
135
+ * mission exists yet. Idempotent and never throws.
136
+ */
137
+ export function autoStartMission(cwd, logger = null) {
138
+ try {
139
+ const settings = qualitySettings();
140
+ if (!settings.enabled || !settings.autoStart) return { created: false, reason: "quality disabled" };
141
+ if (isSkippedRoot(cwd)) return { created: false, reason: "not a project root" };
142
+ if (readMission(cwd)) return { created: false, reason: "mission exists" };
143
+ if (!looksWeb(cwd)) return { created: false, reason: "not a web project" };
144
+ const acceptance = autoAcceptance(cwd);
145
+ const mission = createMission({
146
+ task: `Качество проекта ${path.basename(cwd)}`,
147
+ type: "web-site",
148
+ profile: settings.profile,
149
+ acceptance,
150
+ });
151
+ mission.autoStarted = true;
152
+ writeMission(cwd, mission);
153
+ logger?.info?.(`[quality-pipeline] mission auto-started (${settings.profile}, ${acceptance.length} checks)`);
154
+ return { created: true, mission, checks: acceptance.length };
155
+ } catch (error) {
156
+ logger?.warn?.(`[quality-pipeline] auto-start skipped: ${error instanceof Error ? error.message : String(error)}`);
157
+ return { created: false, reason: "error" };
158
+ }
159
+ }
@@ -0,0 +1,123 @@
1
+ /**
2
+ * Art direction: the brief and the variants that must be chosen before UI work.
3
+ *
4
+ * The gate is intentionally cheap: it does not judge taste, it only refuses to
5
+ * let implementation start while the direction is implicit. A brief names the
6
+ * palette, typefaces, scale, rhythm, radii, motion and references; variants are
7
+ * two or three written directions with one chosen by the owner.
8
+ */
9
+
10
+ export const BRIEF_FIELDS = ["palette", "typefaces", "scale", "rhythm", "radii", "motion", "tone", "references"];
11
+
12
+ export const PREMIUM = /(?:премиаль|premium|редизайн|redesign|новый сайт|new site|лендинг|landing)/iu;
13
+
14
+ export function normalizeBrief(raw = {}) {
15
+ if (!raw || typeof raw !== "object" || Array.isArray(raw)) return null;
16
+ const palette = Array.isArray(raw.palette)
17
+ ? raw.palette
18
+ .map((item) => (typeof item === "string" ? { name: item, value: "" } : item))
19
+ .filter((item) => item && typeof item === "object" && typeof item.name === "string")
20
+ .map((item) => ({ name: String(item.name).slice(0, 40), value: String(item.value ?? "").slice(0, 40), role: String(item.role ?? "").slice(0, 40) }))
21
+ .slice(0, 12)
22
+ : [];
23
+ const typefaces = Array.isArray(raw.typefaces) ? raw.typefaces.map((item) => String(item).slice(0, 60)).filter(Boolean).slice(0, 4) : [];
24
+ const references = Array.isArray(raw.references)
25
+ ? raw.references
26
+ .filter((item) => item && typeof item === "object")
27
+ .map((item) => ({ url: String(item.url ?? "").slice(0, 300), date: String(item.date ?? "").slice(0, 20), take: String(item.take ?? "").slice(0, 300) }))
28
+ .filter((item) => item.url.length > 0)
29
+ .slice(0, 6)
30
+ : [];
31
+ return {
32
+ palette,
33
+ typefaces,
34
+ scale: String(raw.scale ?? "").slice(0, 40),
35
+ rhythm: String(raw.rhythm ?? "").slice(0, 60),
36
+ radii: String(raw.radii ?? "").slice(0, 60),
37
+ motion: String(raw.motion ?? "").slice(0, 60),
38
+ tone: String(raw.tone ?? "").slice(0, 200),
39
+ references,
40
+ updatedAt: new Date().toISOString(),
41
+ };
42
+ }
43
+
44
+ export function normalizeVariants(raw) {
45
+ if (!Array.isArray(raw)) return [];
46
+ return raw
47
+ .filter((item) => item && typeof item === "object")
48
+ .map((item, index) => ({
49
+ id: typeof item.id === "string" && /^[a-z0-9-]{1,20}$/u.test(item.id) ? item.id : `v${index + 1}`,
50
+ title: String(item.title ?? `Вариант ${index + 1}`).slice(0, 120),
51
+ summary: String(item.summary ?? "").slice(0, 600),
52
+ chosen: item.chosen === true,
53
+ }))
54
+ .slice(0, 5);
55
+ }
56
+
57
+ /** What a brief must contain to count as a decision. */
58
+ export function briefMissing(brief) {
59
+ if (!brief) return ["бриф не заполнен"];
60
+ const missing = [];
61
+ if ((brief.palette ?? []).length < 3) missing.push("палитра (минимум 3 цвета с семантикой)");
62
+ if ((brief.typefaces ?? []).length < 1) missing.push("шрифты (1–2 семейства)");
63
+ if (!brief.rhythm) missing.push("ритм отступов (4/8 и --section-y)");
64
+ if (!brief.scale) missing.push("типографическая шкала");
65
+ if ((brief.references ?? []).length < 2) missing.push("2+ референса с датой и «что берём»");
66
+ return missing;
67
+ }
68
+
69
+ /**
70
+ * Two-variant trigger (option 2): a premium task, a turnkey profile or the
71
+ * first page unit in the system/build phase. Small edits stay single-variant.
72
+ */
73
+ export function variantsRequired(mission) {
74
+ const reasons = [];
75
+ if (!mission) return reasons;
76
+ if (String(mission.profile) === "turnkey") reasons.push("профиль turnkey");
77
+ if (PREMIUM.test(String(mission.task ?? ""))) reasons.push("задача про премиум/редизайн");
78
+ const phase = String(mission.phase ?? "");
79
+ if ((phase === "system" || phase === "build") && (mission.units ?? []).some((unit) => unit.kind === "page")) {
80
+ reasons.push("первая страница в фазе " + phase);
81
+ }
82
+ return reasons;
83
+ }
84
+
85
+ export function chosenVariant(mission) {
86
+ const variants = mission?.design?.variants ?? [];
87
+ return variants.find((variant) => variant.chosen === true) ?? null;
88
+ }
89
+
90
+ /**
91
+ * Gate G3 precondition: a brief is mandatory for any profile except `fast`;
92
+ * variants are mandatory when the trigger fires.
93
+ */
94
+ export function briefGateCheck(mission) {
95
+ const profile = String(mission?.profile ?? "standard");
96
+ if (profile === "fast") return { ok: true, missing: [] };
97
+ const missing = briefMissing(mission?.design?.brief);
98
+ const reasons = variantsRequired(mission);
99
+ if (reasons.length > 0) {
100
+ const variants = mission?.design?.variants ?? [];
101
+ if (variants.length < 2) missing.push(`2–3 варианта направления (${reasons.join(", ")})`);
102
+ else if (!chosenVariant(mission)) missing.push("выбранный вариант (choose=<id>)");
103
+ }
104
+ return { ok: missing.length === 0, missing, reasons };
105
+ }
106
+
107
+ export function formatBrief(mission) {
108
+ const brief = mission?.design?.brief;
109
+ const variants = mission?.design?.variants ?? [];
110
+ const chosen = chosenVariant(mission);
111
+ const lines = [];
112
+ if (!brief) lines.push("Бриф: не заполнен");
113
+ else {
114
+ lines.push(`Бриф: палитра ${brief.palette.length} · шрифты ${brief.typefaces.join(", ") || "—"} · шкала ${brief.scale || "—"} · ритм ${brief.rhythm || "—"}`);
115
+ lines.push(` тон: ${brief.tone || "—"} · референсов ${brief.references.length}`);
116
+ }
117
+ lines.push(`Варианты: ${variants.length}${chosen ? ` · выбран ${chosen.id} «${chosen.title}»` : " · не выбран"}`);
118
+ const reasons = variantsRequired(mission);
119
+ if (reasons.length > 0) lines.push(`Триггер вариантов: ${reasons.join(", ")}`);
120
+ const check = briefGateCheck(mission);
121
+ lines.push(check.ok ? "G3-брифинг: PASS" : `G3-брифинг: не хватает — ${check.missing.join("; ")}`);
122
+ return lines.join("\n");
123
+ }