codeloop-mcp-server 0.1.78 → 0.1.82

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 (48) hide show
  1. package/dist/evidence/agent_mode.d.ts +13 -3
  2. package/dist/evidence/agent_mode.d.ts.map +1 -1
  3. package/dist/evidence/agent_mode.js +63 -22
  4. package/dist/evidence/agent_mode.js.map +1 -1
  5. package/dist/evidence/interaction_evidence.d.ts +1 -1
  6. package/dist/evidence/interaction_evidence.d.ts.map +1 -1
  7. package/dist/evidence/interaction_evidence.js +3 -2
  8. package/dist/evidence/interaction_evidence.js.map +1 -1
  9. package/dist/index.js +22 -23
  10. package/dist/index.js.map +1 -1
  11. package/dist/runners/app_launcher.d.ts.map +1 -1
  12. package/dist/runners/app_launcher.js +148 -8
  13. package/dist/runners/app_launcher.js.map +1 -1
  14. package/dist/runners/device_probe.d.ts +32 -0
  15. package/dist/runners/device_probe.d.ts.map +1 -1
  16. package/dist/runners/device_probe.js +73 -0
  17. package/dist/runners/device_probe.js.map +1 -1
  18. package/dist/runners/flutter_driver.d.ts +37 -0
  19. package/dist/runners/flutter_driver.d.ts.map +1 -0
  20. package/dist/runners/flutter_driver.js +242 -0
  21. package/dist/runners/flutter_driver.js.map +1 -0
  22. package/dist/runners/journey_to_maestro.d.ts.map +1 -1
  23. package/dist/runners/journey_to_maestro.js +39 -8
  24. package/dist/runners/journey_to_maestro.js.map +1 -1
  25. package/dist/runners/launch_liveness.d.ts +44 -0
  26. package/dist/runners/launch_liveness.d.ts.map +1 -0
  27. package/dist/runners/launch_liveness.js +145 -0
  28. package/dist/runners/launch_liveness.js.map +1 -0
  29. package/dist/runners/maestro_generator.d.ts +7 -0
  30. package/dist/runners/maestro_generator.d.ts.map +1 -1
  31. package/dist/runners/maestro_generator.js +58 -0
  32. package/dist/runners/maestro_generator.js.map +1 -1
  33. package/dist/runners/mobile_build_prep.d.ts +66 -0
  34. package/dist/runners/mobile_build_prep.d.ts.map +1 -0
  35. package/dist/runners/mobile_build_prep.js +285 -0
  36. package/dist/runners/mobile_build_prep.js.map +1 -0
  37. package/dist/tools/gate_check.d.ts +15 -1
  38. package/dist/tools/gate_check.d.ts.map +1 -1
  39. package/dist/tools/gate_check.js +18 -11
  40. package/dist/tools/gate_check.js.map +1 -1
  41. package/dist/tools/run_journey.d.ts +19 -5
  42. package/dist/tools/run_journey.d.ts.map +1 -1
  43. package/dist/tools/run_journey.js +133 -39
  44. package/dist/tools/run_journey.js.map +1 -1
  45. package/dist/tools/verify.d.ts.map +1 -1
  46. package/dist/tools/verify.js +9 -16
  47. package/dist/tools/verify.js.map +1 -1
  48. package/package.json +2 -2
@@ -20,6 +20,12 @@ export function stepToYaml(step) {
20
20
  const tapMatch = lower.match(/^tap\s+(\d+)\s+(\d+)$/);
21
21
  if (tapMatch)
22
22
  return `- tapOn:\n point: "${tapMatch[1]},${tapMatch[2]}"`;
23
+ // OPTIONAL tap — won't abort the flow if the label isn't found (the dominant
24
+ // Flutter hit-rate safeguard: a wrong/missing label still lets the rest of
25
+ // the journey + screenshots run).
26
+ const tapOptMatch = step.match(/^tap\s+optional\s+"(.+)"$/i);
27
+ if (tapOptMatch)
28
+ return `- tapOn:\n text: "${tapOptMatch[1]}"\n optional: true`;
23
29
  const tapTextMatch = step.match(/^tap\s+"(.+)"$/i) || step.match(/^tap\s+on\s+"(.+)"$/i);
24
30
  if (tapTextMatch)
25
31
  return `- tapOn: "${tapTextMatch[1]}"`;
@@ -43,6 +49,14 @@ export function stepToYaml(step) {
43
49
  const waitMatch = lower.match(/^wait\s+(\d+)$/);
44
50
  if (waitMatch)
45
51
  return `- waitForAnimationToEnd:\n timeout: ${waitMatch[1]}`;
52
+ // Settle wait — let Flutter finish a route transition/animation before the
53
+ // next match, which materially improves the next tapOn/assert hit-rate.
54
+ if (lower === "wait for idle" || lower === "wait for animation")
55
+ return "- waitForAnimationToEnd:\n timeout: 5000";
56
+ // OPTIONAL assert — records the expectation without failing the flow on miss.
57
+ const assertOptMatch = step.match(/^assert\s+visible\s+optional\s+"(.+)"$/i);
58
+ if (assertOptMatch)
59
+ return `- assertVisible:\n text: "${assertOptMatch[1]}"\n optional: true`;
46
60
  // assert visible "<text>" timeout <ms> -> wait up to <ms> for it to appear
47
61
  // (used for AI replies / async content that takes a moment to render).
48
62
  const assertTimeoutMatch = step.match(/^assert\s+visible\s+"(.+)"\s+timeout\s+(\d+)$/i);
@@ -68,8 +82,52 @@ export function stepToYaml(step) {
68
82
  const longPressMatch = step.match(/^long\s*press\s+"(.+)"$/i);
69
83
  if (longPressMatch)
70
84
  return `- longPressOn: "${longPressMatch[1]}"`;
85
+ // Capture the text of a matched element (e.g. an AI reply) into
86
+ // ${maestro.copiedText} so the answer can be inspected, not just seen.
87
+ const copyMatch = step.match(/^copy\s+text\s+from\s+"(.+)"$/i);
88
+ if (copyMatch)
89
+ return `- copyTextFrom:\n text: "${copyMatch[1]}"`;
71
90
  return `# Unrecognized step: ${step}`;
72
91
  }
92
+ /**
93
+ * PURE: summarise which Maestro commands FAILED from its output, so the agent
94
+ * sees exactly which label(s) didn't match (e.g. an unlabeled Flutter widget)
95
+ * instead of a raw log tail. Never invents labels — only echoes what Maestro
96
+ * reported. Returns [] when nothing failed / nothing recognizable.
97
+ */
98
+ export function summarizeMaestroFailures(output) {
99
+ const out = [];
100
+ const seen = new Set();
101
+ const push = (s) => {
102
+ const t = s.trim();
103
+ if (t && !seen.has(t)) {
104
+ seen.add(t);
105
+ out.push(t);
106
+ }
107
+ };
108
+ for (const raw of output.split(/\r?\n/)) {
109
+ // eslint-disable-next-line no-control-regex -- strip ANSI colour codes
110
+ const line = raw.replace(/\u001b\[[0-9;]*m/g, "").trim();
111
+ // Maestro emits "Element not found: Text matching regex: Save" and
112
+ // "Assertion is false: ..." / "❌ Tap on ...".
113
+ const notFound = line.match(/element not found:?\s*(.+)$/i);
114
+ if (notFound) {
115
+ push(`Not found: ${notFound[1]}`);
116
+ continue;
117
+ }
118
+ const assertion = line.match(/assertion is false:?\s*(.+)$/i);
119
+ if (assertion) {
120
+ push(`Assertion failed: ${assertion[1]}`);
121
+ continue;
122
+ }
123
+ if (/^[✗✘❌]/.test(line) || /\bFAILED\b/.test(line)) {
124
+ const cleaned = line.replace(/^[✗✘❌]\s*/, "");
125
+ if (cleaned)
126
+ push(cleaned);
127
+ }
128
+ }
129
+ return out.slice(0, 12);
130
+ }
73
131
  export async function runGeneratedFlow(flowPath, cwd) {
74
132
  if (!(await checkToolAvailable("maestro"))) {
75
133
  return { success: false, output: "", error: "Maestro is not installed. Install with: curl -Ls https://get.maestro.mobile.dev | bash" };
@@ -1 +1 @@
1
- {"version":3,"file":"maestro_generator.js","sourceRoot":"","sources":["../../src/runners/maestro_generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE3D,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,KAAe,EACf,GAAW,EACX,OAA+C,EAAE;IAEjD,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;IAC3D,SAAS,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAE3C,6EAA6E;IAC7E,yDAAyD;IACzD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC;IAChF,MAAM,SAAS,GAAG,CAAC,UAAU,KAAK,EAAE,EAAE,KAAK,CAAC,CAAC;IAC7C,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;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AE,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM;QACrC,KAAK,EAAE,MAAM,CAAC,SAAS,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;KAC1D,CAAC;AACJ,CAAC"}
@@ -0,0 +1,66 @@
1
+ import type { JourneyTarget } from "./interaction_engine.js";
2
+ import type { AgentMode } from "../evidence/agent_mode.js";
3
+ export interface BuildPrepFinding {
4
+ kind: "missing_asset_dir" | "missing_asset_file" | "stale_pods" | "cli_auth" | "build_error" | "dependency";
5
+ severity: "blocker" | "warning";
6
+ detail: string;
7
+ /** Concrete command / action that resolves it. */
8
+ fix: string;
9
+ }
10
+ export interface MobileBuildPrepResult {
11
+ applicable: boolean;
12
+ mode: AgentMode;
13
+ /** Commands actually executed (fix mode) — pub get / pod install / mkdir. */
14
+ ran: string[];
15
+ findings: BuildPrepFinding[];
16
+ /** True when no BLOCKER finding remains (the launch can be attempted clean). */
17
+ ok: boolean;
18
+ /** Human-readable summary for notes / directives. */
19
+ directive?: string;
20
+ }
21
+ /**
22
+ * PURE: extract the declared asset paths from a pubspec.yaml's `flutter:
23
+ * assets:` block. Line-based (no YAML dep): finds an `assets:` key and collects
24
+ * the `- <path>` list items indented beneath it, stopping when indentation
25
+ * returns to the key's level or shallower.
26
+ */
27
+ export declare function parsePubspecAssets(pubspecText: string): string[];
28
+ /**
29
+ * PURE-ish (fs existence): which declared assets are missing on disk. A path
30
+ * ending in `/` is a directory; otherwise it is treated as a file.
31
+ */
32
+ export declare function missingAssets(cwd: string, assets: string[]): Array<{
33
+ path: string;
34
+ isDir: boolean;
35
+ }>;
36
+ /**
37
+ * PURE: map a build/launch failure tail to specific, actionable repair findings.
38
+ * Returns [] when nothing recognizable is present (caller keeps the raw tail).
39
+ */
40
+ export declare function classifyBuildFailure(text: string): BuildPrepFinding[];
41
+ export interface BuildPrepCommand {
42
+ cmd: string;
43
+ args: string[];
44
+ cwd: string;
45
+ label: string;
46
+ }
47
+ /**
48
+ * PURE-ish: the remediation commands to run for a target, in order. Only emits
49
+ * a command when its inputs exist (pubspec.yaml for pub get, ios/Podfile for
50
+ * pod install). pod install is macOS-only.
51
+ */
52
+ export declare function planBuildPrepCommands(cwd: string, target: JourneyTarget): BuildPrepCommand[];
53
+ export interface PrepareMobileBuildOptions {
54
+ cwd: string;
55
+ target: JourneyTarget;
56
+ mode: AgentMode;
57
+ /** Where to tee prep output (best-effort). */
58
+ logPath?: string;
59
+ }
60
+ /**
61
+ * Run (fix) or list (audit) the mobile build pre-flight before launch. Never
62
+ * throws; always returns a result the orchestrator can fold into its notes /
63
+ * directive.
64
+ */
65
+ export declare function prepareMobileBuild(opts: PrepareMobileBuildOptions): Promise<MobileBuildPrepResult>;
66
+ //# sourceMappingURL=mobile_build_prep.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mobile_build_prep.d.ts","sourceRoot":"","sources":["../../src/runners/mobile_build_prep.ts"],"names":[],"mappings":"AA8BA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAE3D,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EACA,mBAAmB,GACnB,oBAAoB,GACpB,YAAY,GACZ,UAAU,GACV,aAAa,GACb,YAAY,CAAC;IACjB,QAAQ,EAAE,SAAS,GAAG,SAAS,CAAC;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,kDAAkD;IAClD,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,OAAO,CAAC;IACpB,IAAI,EAAE,SAAS,CAAC;IAChB,6EAA6E;IAC7E,GAAG,EAAE,MAAM,EAAE,CAAC;IACd,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,gFAAgF;IAChF,EAAE,EAAE,OAAO,CAAC;IACZ,qDAAqD;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAKD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,CAsChE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,EAAE,GACf,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAAC,CAQzC;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAqDrE;AAED,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,GAAG,gBAAgB,EAAE,CAe5F;AAED,MAAM,WAAW,yBAAyB;IACxC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,aAAa,CAAC;IACtB,IAAI,EAAE,SAAS,CAAC;IAChB,8CAA8C;IAC9C,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;GAIG;AACH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,yBAAyB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CA0FxG"}
@@ -0,0 +1,285 @@
1
+ /**
2
+ * mobile_build_prep — the missing PRE-FLIGHT step before CodeLoop launches a
3
+ * mobile / Flutter app for the deep-E2E journey.
4
+ *
5
+ * The recurring WedCheese failure ("the app never opened") was, at its root, a
6
+ * BUILD-prep gap: `flutter run` was invoked with `--no-pub` (so `pub get` never
7
+ * ran) and there was NO `pod install` and NO asset-presence check anywhere. So
8
+ * the iOS build died on `Module 'cloud_firestore' not found`, on a missing
9
+ * `assets/animations/` dir declared in pubspec.yaml, etc. — and the journey
10
+ * could never reach the visual phase.
11
+ *
12
+ * This module closes that gap, honoring the active-loop-by-default principle:
13
+ * - FIX mode: actually REMEDIATE — run `flutter pub get`, `pod install`, and
14
+ * create missing declared asset DIRECTORIES (build setup, not app-source
15
+ * edits) so the subsequent launch can succeed.
16
+ * - AUDIT mode: do NOT mutate the project — LIST the same fixes as findings.
17
+ *
18
+ * Build/launch failure signatures are mapped to SPECIFIC repair findings
19
+ * (e.g. `Module 'X' not found` -> `cd ios && pod install`) instead of a raw
20
+ * error tail, so the agent gets an actionable next step.
21
+ *
22
+ * Pure helpers (parsePubspecAssets / missingAssets / classifyBuildFailure /
23
+ * planBuildPrepCommands) are unit-tested; the executor degrades gracefully and
24
+ * never throws.
25
+ */
26
+ import { existsSync, mkdirSync } from "fs";
27
+ import { readFileSync } from "fs";
28
+ import { join } from "path";
29
+ import { platform } from "os";
30
+ import { runCommand, checkToolAvailable } from "./base.js";
31
+ /** Cold `pub get` + `pod install` can take minutes; keep a generous cap. */
32
+ const PREP_TIMEOUT_MS = 300_000;
33
+ /**
34
+ * PURE: extract the declared asset paths from a pubspec.yaml's `flutter:
35
+ * assets:` block. Line-based (no YAML dep): finds an `assets:` key and collects
36
+ * the `- <path>` list items indented beneath it, stopping when indentation
37
+ * returns to the key's level or shallower.
38
+ */
39
+ export function parsePubspecAssets(pubspecText) {
40
+ const lines = pubspecText.split(/\r?\n/);
41
+ const assets = [];
42
+ let inAssets = false;
43
+ let assetsIndent = -1;
44
+ for (const raw of lines) {
45
+ // Ignore comments / blank lines for the indentation logic.
46
+ const line = raw.replace(/#.*$/, "");
47
+ if (line.trim() === "")
48
+ continue;
49
+ const indent = line.length - line.trimStart().length;
50
+ if (!inAssets) {
51
+ if (/^\s*assets\s*:\s*$/.test(line)) {
52
+ inAssets = true;
53
+ assetsIndent = indent;
54
+ }
55
+ continue;
56
+ }
57
+ // Inside the assets block: a list item at deeper indent is an entry.
58
+ const item = line.match(/^\s*-\s+(.+?)\s*$/);
59
+ if (item && indent > assetsIndent) {
60
+ // Strip surrounding quotes if present.
61
+ assets.push(item[1].replace(/^["']|["']$/g, "").trim());
62
+ continue;
63
+ }
64
+ // A non-list line at the same/shallower indent ends the block.
65
+ if (indent <= assetsIndent) {
66
+ inAssets = false;
67
+ assetsIndent = -1;
68
+ // Re-check: this line might itself start a new assets block.
69
+ if (/^\s*assets\s*:\s*$/.test(line)) {
70
+ inAssets = true;
71
+ assetsIndent = indent;
72
+ }
73
+ }
74
+ }
75
+ return assets;
76
+ }
77
+ /**
78
+ * PURE-ish (fs existence): which declared assets are missing on disk. A path
79
+ * ending in `/` is a directory; otherwise it is treated as a file.
80
+ */
81
+ export function missingAssets(cwd, assets) {
82
+ const out = [];
83
+ for (const a of assets) {
84
+ if (!a)
85
+ continue;
86
+ const abs = join(cwd, a);
87
+ if (!existsSync(abs))
88
+ out.push({ path: a, isDir: a.endsWith("/") });
89
+ }
90
+ return out;
91
+ }
92
+ /**
93
+ * PURE: map a build/launch failure tail to specific, actionable repair findings.
94
+ * Returns [] when nothing recognizable is present (caller keeps the raw tail).
95
+ */
96
+ export function classifyBuildFailure(text) {
97
+ const findings = [];
98
+ const seen = new Set();
99
+ const add = (f) => {
100
+ if (seen.has(f.kind + f.detail))
101
+ return;
102
+ seen.add(f.kind + f.detail);
103
+ findings.push(f);
104
+ };
105
+ // iOS native module not found -> CocoaPods dependencies not installed.
106
+ const mod = text.match(/Module '([^']+)' not found/i) || text.match(/could not find module '([^']+)'/i);
107
+ if (mod) {
108
+ add({
109
+ kind: "build_error",
110
+ severity: "blocker",
111
+ detail: `iOS native module '${mod[1]}' not found — CocoaPods dependencies are not installed.`,
112
+ fix: "cd ios && pod install (then re-run codeloop_run_journey)",
113
+ });
114
+ }
115
+ if (/pod(file)?\b.*not (found|installed)|`pod` not found|pod: command not found/i.test(text)) {
116
+ add({
117
+ kind: "dependency",
118
+ severity: "blocker",
119
+ detail: "CocoaPods is not installed on this machine.",
120
+ fix: "sudo gem install cocoapods (or: brew install cocoapods)",
121
+ });
122
+ }
123
+ // Missing declared asset directory / file.
124
+ const asset = text.match(/unable to find directory entry in pubspec\.yaml:\s*(\S+)/i) ||
125
+ text.match(/no file or variants found for asset:\s*(\S+)/i) ||
126
+ text.match(/asset (?:directory|file) ['"]?(\S+?)['"]? (?:does not exist|not found)/i);
127
+ if (asset) {
128
+ add({
129
+ kind: asset[1].endsWith("/") ? "missing_asset_dir" : "missing_asset_file",
130
+ severity: "blocker",
131
+ detail: `Declared asset '${asset[1]}' is missing on disk.`,
132
+ fix: asset[1].endsWith("/")
133
+ ? `Create the directory '${asset[1]}' (and add the asset files), or remove the line from pubspec.yaml.`
134
+ : `Add the file '${asset[1]}', or remove the line from pubspec.yaml.`,
135
+ });
136
+ }
137
+ // Expired provider CLI login surfaced during build (e.g. firebase).
138
+ const reauth = text.match(/run ([a-z]+) login(?: --reauth)?/i);
139
+ if (reauth || /credentials are no longer valid|not authenticated|reauthenticate/i.test(text)) {
140
+ add({
141
+ kind: "cli_auth",
142
+ severity: "blocker",
143
+ detail: "A provider CLI login appears to have expired during the build.",
144
+ fix: reauth ? `${reauth[1]} login --reauth` : "Re-authenticate the provider CLI (see [CodeLoop AUTH]).",
145
+ });
146
+ }
147
+ return findings;
148
+ }
149
+ /**
150
+ * PURE-ish: the remediation commands to run for a target, in order. Only emits
151
+ * a command when its inputs exist (pubspec.yaml for pub get, ios/Podfile for
152
+ * pod install). pod install is macOS-only.
153
+ */
154
+ export function planBuildPrepCommands(cwd, target) {
155
+ const cmds = [];
156
+ const isFlutter = existsSync(join(cwd, "pubspec.yaml"));
157
+ if (isFlutter) {
158
+ cmds.push({ cmd: "flutter", args: ["pub", "get"], cwd, label: "flutter pub get" });
159
+ }
160
+ const wantsIos = target === "ios_simulator" || existsSync(join(cwd, "ios", "Podfile")) || existsSync(join(cwd, "Podfile"));
161
+ if (wantsIos && platform() === "darwin") {
162
+ const iosDir = existsSync(join(cwd, "ios", "Podfile")) ? join(cwd, "ios") : cwd;
163
+ if (existsSync(join(iosDir, "Podfile"))) {
164
+ cmds.push({ cmd: "pod", args: ["install"], cwd: iosDir, label: "pod install (ios)" });
165
+ }
166
+ }
167
+ return cmds;
168
+ }
169
+ /**
170
+ * Run (fix) or list (audit) the mobile build pre-flight before launch. Never
171
+ * throws; always returns a result the orchestrator can fold into its notes /
172
+ * directive.
173
+ */
174
+ export async function prepareMobileBuild(opts) {
175
+ const { cwd, target, mode } = opts;
176
+ const isFlutter = existsSync(join(cwd, "pubspec.yaml"));
177
+ const hasNative = existsSync(join(cwd, "ios")) || existsSync(join(cwd, "android")) || existsSync(join(cwd, "Podfile"));
178
+ if (!isFlutter && !hasNative) {
179
+ return { applicable: false, mode, ran: [], findings: [], ok: true };
180
+ }
181
+ const ran = [];
182
+ const findings = [];
183
+ // 1. Declared-asset presence (always computed).
184
+ let assets = [];
185
+ try {
186
+ const pub = join(cwd, "pubspec.yaml");
187
+ if (existsSync(pub))
188
+ assets = parsePubspecAssets(readFileSync(pub, "utf-8"));
189
+ }
190
+ catch { /* best-effort */ }
191
+ const missing = missingAssets(cwd, assets);
192
+ for (const m of missing) {
193
+ if (m.isDir && mode === "fix") {
194
+ // Creating the declared directory unblocks the build's asset resolution
195
+ // (Flutter fails the build when a declared asset dir does not exist).
196
+ try {
197
+ mkdirSync(join(cwd, m.path), { recursive: true });
198
+ ran.push(`mkdir -p ${m.path}`);
199
+ findings.push({
200
+ kind: "missing_asset_dir",
201
+ severity: "warning",
202
+ detail: `Created missing declared asset directory '${m.path}' (it was empty on disk).`,
203
+ fix: `Add the actual asset files to '${m.path}'.`,
204
+ });
205
+ }
206
+ catch {
207
+ findings.push({
208
+ kind: "missing_asset_dir",
209
+ severity: "blocker",
210
+ detail: `Declared asset directory '${m.path}' is missing and could not be created.`,
211
+ fix: `Create '${m.path}' or remove the line from pubspec.yaml.`,
212
+ });
213
+ }
214
+ }
215
+ else {
216
+ findings.push({
217
+ kind: m.isDir ? "missing_asset_dir" : "missing_asset_file",
218
+ severity: "blocker",
219
+ detail: `Declared asset '${m.path}' is missing on disk.`,
220
+ fix: m.isDir
221
+ ? `Create the directory '${m.path}' (and add the asset files), or remove the line from pubspec.yaml.`
222
+ : `Add the file '${m.path}', or remove the line from pubspec.yaml.`,
223
+ });
224
+ }
225
+ }
226
+ // 2. Dependency remediation (pub get / pod install).
227
+ const cmds = planBuildPrepCommands(cwd, target);
228
+ for (const c of cmds) {
229
+ if (mode === "audit") {
230
+ findings.push({
231
+ kind: "dependency",
232
+ severity: "warning",
233
+ detail: `Build dependency step not run (audit/read-only): ${c.label}.`,
234
+ fix: `${c.label} (run in ${c.cwd})`,
235
+ });
236
+ continue;
237
+ }
238
+ // fix mode: actually run it (build setup, not app-source edits).
239
+ if (!(await checkToolAvailable(c.cmd))) {
240
+ findings.push({
241
+ kind: "dependency",
242
+ severity: "blocker",
243
+ detail: `'${c.cmd}' is not on PATH — cannot run ${c.label}.`,
244
+ fix: c.cmd === "pod" ? "sudo gem install cocoapods (or brew install cocoapods)" : `Install ${c.cmd}.`,
245
+ });
246
+ continue;
247
+ }
248
+ const res = await runCommand(c.cmd, c.args, c.cwd, opts.logPath, undefined, PREP_TIMEOUT_MS);
249
+ ran.push(c.label);
250
+ if (res.exit_code !== 0) {
251
+ const classified = classifyBuildFailure(res.stdout + "\n" + res.stderr);
252
+ if (classified.length > 0)
253
+ findings.push(...classified);
254
+ else
255
+ findings.push({
256
+ kind: "build_error",
257
+ severity: "blocker",
258
+ detail: `${c.label} failed (exit ${res.exit_code}).`,
259
+ fix: `Inspect: ${c.label} in ${c.cwd}.`,
260
+ });
261
+ }
262
+ }
263
+ const ok = !findings.some((f) => f.severity === "blocker");
264
+ return { applicable: true, mode, ran, findings, ok, directive: buildPrepDirective({ mode, ran, findings, ok }) };
265
+ }
266
+ function buildPrepDirective(r) {
267
+ if (r.ran.length === 0 && r.findings.length === 0)
268
+ return undefined;
269
+ const lines = [];
270
+ if (r.ran.length > 0)
271
+ lines.push(`Build pre-flight ran: ${r.ran.join(", ")}.`);
272
+ const blockers = r.findings.filter((f) => f.severity === "blocker");
273
+ if (blockers.length > 0) {
274
+ lines.push(r.mode === "audit"
275
+ ? `${blockers.length} build prerequisite(s) need attention before the app can launch (audit — listing only):`
276
+ : `${blockers.length} build prerequisite(s) still block launch — fix then re-run codeloop_run_journey:`);
277
+ for (const f of blockers.slice(0, 8))
278
+ lines.push(` • ${f.detail} -> ${f.fix}`);
279
+ }
280
+ const warns = r.findings.filter((f) => f.severity === "warning");
281
+ for (const f of warns.slice(0, 6))
282
+ lines.push(` (note) ${f.detail}`);
283
+ return lines.length > 0 ? lines.join("\n") : undefined;
284
+ }
285
+ //# sourceMappingURL=mobile_build_prep.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mobile_build_prep.js","sourceRoot":"","sources":["../../src/runners/mobile_build_prep.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AA8B3D,4EAA4E;AAC5E,MAAM,eAAe,GAAG,OAAO,CAAC;AAEhC;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,WAAmB;IACpD,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACzC,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,IAAI,QAAQ,GAAG,KAAK,CAAC;IACrB,IAAI,YAAY,GAAG,CAAC,CAAC,CAAC;IACtB,KAAK,MAAM,GAAG,IAAI,KAAK,EAAE,CAAC;QACxB,2DAA2D;QAC3D,MAAM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AC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC;IACjE,KAAK,MAAM,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;QAAE,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;IACtE,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACzD,CAAC"}
@@ -1,5 +1,19 @@
1
- import type { GateCheckInput, GateCheckOutput, CodeLoopConfig } from "@codelooptech/shared";
1
+ import type { GateCheckInput, GateCheckOutput, GatePolicy, CodeLoopConfig } from "@codelooptech/shared";
2
+ interface GateEvaluation {
3
+ gate: GatePolicy;
4
+ passed: boolean;
5
+ reason: string;
6
+ }
2
7
  export declare function runGateCheck(input: GateCheckInput, config: CodeLoopConfig, cwd?: string): Promise<GateCheckOutput>;
3
8
  import { isUIProject } from "./is_ui_project.js";
4
9
  export { isUIProject };
10
+ /**
11
+ * Build the UI-only evidence gates (interaction_evidence, screenshot_evidence,
12
+ * …) for a run. Exported so the guaranteed-invocation backstop can be regression
13
+ * -tested directly: for a UI project with no interaction evidence the
14
+ * interaction_evidence gate MUST be present, a blocker, and failing — this is
15
+ * what keeps gate_check returning continue_fixing until the app is driven, in
16
+ * every mode (the WedCheese "run_journey never called" failure).
17
+ */
18
+ export declare function evaluateEvidenceGates(runId: string, cwd: string, config: CodeLoopConfig): Promise<GateEvaluation[]>;
5
19
  //# sourceMappingURL=gate_check.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"gate_check.d.ts","sourceRoot":"","sources":["../../src/tools/gate_check.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EAEf,cAAc,EAEf,MAAM,sBAAsB,CAAC;AAkE9B,wBAAsB,YAAY,CAChC,KAAK,EAAE,cAAc,EACrB,MAAM,EAAE,cAAc,EACtB,GAAG,GAAE,MAAsB,GAC1B,OAAO,CAAC,eAAe,CAAC,CAwG1B;AA6ED,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,CAAC"}
1
+ {"version":3,"file":"gate_check.d.ts","sourceRoot":"","sources":["../../src/tools/gate_check.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EACf,UAAU,EACV,cAAc,EAEf,MAAM,sBAAsB,CAAC;AA2D9B,UAAU,cAAc;IACtB,IAAI,EAAE,UAAU,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAsB,YAAY,CAChC,KAAK,EAAE,cAAc,EACrB,MAAM,EAAE,cAAc,EACtB,GAAG,GAAE,MAAsB,GAC1B,OAAO,CAAC,eAAe,CAAC,CAwG1B;AA6ED,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,CAAC;AAiCvB;;;;;;;GAOG;AACH,wBAAsB,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAugBzH"}
@@ -14,7 +14,6 @@ import { loadBackendVerification, evaluateBackendSmokeGate, evaluateApiContractG
14
14
  import { loadRuntimeLogScan, evaluateRuntimeLogGate, } from "../evidence/runtime_log_scan.js";
15
15
  import { loadObservabilityEvidence, evaluateObservabilityGate, } from "../evidence/observability.js";
16
16
  import { loadLatestInteractionEvidence, evaluateInteractionEvidenceGate, } from "../evidence/interaction_evidence.js";
17
- import { resolveAgentMode } from "../evidence/agent_mode.js";
18
17
  export async function runGateCheck(input, config, cwd = process.cwd()) {
19
18
  const baseDir = getArtifactsBaseDir(cwd);
20
19
  const meta = loadRunMeta(input.run_id, baseDir);
@@ -208,31 +207,39 @@ function hasUploadRunner(cwd) {
208
207
  return false;
209
208
  }
210
209
  }
211
- async function evaluateEvidenceGates(runId, cwd, config) {
210
+ /**
211
+ * Build the UI-only evidence gates (interaction_evidence, screenshot_evidence,
212
+ * …) for a run. Exported so the guaranteed-invocation backstop can be regression
213
+ * -tested directly: for a UI project with no interaction evidence the
214
+ * interaction_evidence gate MUST be present, a blocker, and failing — this is
215
+ * what keeps gate_check returning continue_fixing until the app is driven, in
216
+ * every mode (the WedCheese "run_journey never called" failure).
217
+ */
218
+ export async function evaluateEvidenceGates(runId, cwd, config) {
212
219
  if (!isUIProject(cwd))
213
220
  return [];
214
221
  const baseDir = getArtifactsBaseDir(cwd);
215
222
  const runDir = getRunDir(runId, baseDir);
216
223
  const results = [];
217
224
  // interaction_evidence — umbrella gate proving the app was actually DRIVEN
218
- // (run_journey OR the manual record->interact flow). Applicable-or-n/a: in
219
- // audit (read-only) mode the app is never driven, so the gate is n/a.
225
+ // (run_journey OR the manual record->interact flow). It applies in EVERY mode:
226
+ // driving the app is verification, not a code edit, so a "don't modify my code"
227
+ // request never makes it n/a — CodeLoop must still produce the evidence.
220
228
  const interactionGate = {
221
229
  name: "interaction_evidence",
222
230
  description: "The running app must be driven with real interactions (typing/tapping/submitting) for UI projects.",
223
- rule: "A fresh run_journey interaction_evidence.json OR an interaction_log.jsonl exists (n/a in audit mode).",
231
+ rule: "A fresh run_journey interaction_evidence.json OR an interaction_log.jsonl exists.",
224
232
  input_artifacts: ["interaction_evidence.json", "logs/interaction_log.jsonl"],
225
233
  pass_threshold: true,
226
234
  severity_if_failed: "blocker",
227
235
  retry_allowance: 5,
228
236
  escalation_condition: "No interactive testing after 5 attempts (a non-building app can't be driven — fix the build first)",
229
237
  };
230
- const auditMode = resolveAgentMode({ cwd, configMode: config.agent_mode }) === "audit";
231
- if (auditMode) {
232
- results.push({ gate: interactionGate, passed: true, reason: "n/a — audit (read-only) mode does not drive the app." });
233
- }
234
- else {
235
- const runsDir = join(baseDir, "runs");
238
+ {
239
+ // getArtifactsBaseDir already ends in `/runs` — pass it straight through
240
+ // (NOT join(baseDir,"runs"), which double-nests and made the gate blind to
241
+ // the run_journey evidence, so it could NEVER pass once the app was driven).
242
+ const runsDir = baseDir;
236
243
  const journeyEvidence = loadLatestInteractionEvidence(runsDir);
237
244
  const journeyStale = journeyEvidence ? isEvidenceStale(cwd, journeyEvidence.mtimeMs).stale : false;
238
245
  const hasManualInteractionLogs = newestInteractionLogMtime(cwd) > 0;