@aarwitz/tapp 0.17.25 → 0.17.26
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.
- package/.claude-plugin/plugin.json +2 -2
- package/AGENTS.md +21 -0
- package/mcp-server/src/html-report.js +2 -0
- package/mcp-server/src/ios-crash-attribution.js +133 -0
- package/mcp-server/src/report.js +50 -3
- package/package.json +3 -2
- package/scripts/attribute-ios-crash.js +29 -0
- package/scripts/quick-capture.sh +7 -0
- package/skills/tapp/SKILL.md +11 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tapp",
|
|
3
3
|
"description": "Give Claude hands and eyes on iOS, Android, and web apps, with exploration, replayable flows, evidence, and deterministic CI gates.",
|
|
4
|
-
"version": "0.17.
|
|
4
|
+
"version": "0.17.26",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Aaron Horowitz",
|
|
7
7
|
"url": "https://github.com/aarwitz"
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"command": "npx",
|
|
25
25
|
"args": [
|
|
26
26
|
"-y",
|
|
27
|
-
"@aarwitz/tapp@0.17.
|
|
27
|
+
"@aarwitz/tapp@0.17.26",
|
|
28
28
|
"mcp"
|
|
29
29
|
],
|
|
30
30
|
"cwd": "${CLAUDE_PROJECT_DIR}"
|
package/AGENTS.md
CHANGED
|
@@ -217,3 +217,24 @@ without a coding agent, model, subscription, or API key. AI generation and `asse
|
|
|
217
217
|
and never present another project's capture as this project's evidence or borrow it as a fixture.
|
|
218
218
|
- A clean `tapp_audit` means the page is served without structural defects. It says nothing about
|
|
219
219
|
behaviour, because nothing was clicked; never report it as "the site works".
|
|
220
|
+
|
|
221
|
+
## File feedback on tapp itself — don't just work around it
|
|
222
|
+
|
|
223
|
+
Tapp is still being hardened, and a rough edge in Tapp is not the same thing as a defect in the
|
|
224
|
+
app under test. File it with `tapp_feedback` (or `npx -y @aarwitz/tapp@latest feedback "title"`)
|
|
225
|
+
as soon as you notice, not after you've already found a workaround and moved on — draft only;
|
|
226
|
+
`submit:true` needs the user's OK first, since filing posts a public GitHub issue. File when you
|
|
227
|
+
see any of:
|
|
228
|
+
|
|
229
|
+
- A command's documented or expected behavior doesn't match what happened (a flag silently
|
|
230
|
+
ignored, a field `null`/missing when it should be populated).
|
|
231
|
+
- A crash, hang, or unexplained failure from the underlying platform tooling (simulator, emulator,
|
|
232
|
+
browser) rather than the app under test.
|
|
233
|
+
- You had to invent a workaround to get a straightforward task done.
|
|
234
|
+
- A result that technically succeeded but didn't do what it clearly should have (`ok` with no
|
|
235
|
+
actual state change, `inconclusive` for a reason that doesn't match the documented causes).
|
|
236
|
+
- You're not sure whether something is a real app finding or a Tapp bug — file it rather than
|
|
237
|
+
silently deciding either way.
|
|
238
|
+
|
|
239
|
+
One file per distinct issue. Lean toward filing when unsure: a closed non-issue costs nothing, a
|
|
240
|
+
bug nobody ever reported stays a bug.
|
|
@@ -82,6 +82,8 @@ export function writeHtmlReport(captureDir, { report, label = "", recordingWarni
|
|
|
82
82
|
(f) => `<li>
|
|
83
83
|
<span class="sev" style="background:${SEV_COLOR[f.severity] || "#57606a"}">${esc(f.severity)}</span>
|
|
84
84
|
${esc(f.title)}${f.screen ? ` <span class="dim">— on ${esc(f.screen)}</span>` : ""}${f.url ? ` <span class="dim">— ${esc(f.url)}</span>` : ""}
|
|
85
|
+
${f.crashReport ? `<div class="dim">crash report: ${esc(f.crashReport)}</div>` : ""}
|
|
86
|
+
${f.attributionNote ? `<div class="dim">${esc(f.attributionNote)}</div>` : ""}
|
|
85
87
|
${f.aiAnalysis ? `<div class="ai">why: ${esc(f.aiAnalysis)}</div>` : ""}
|
|
86
88
|
${f.suggestedFix ? `<div class="ai">fix: ${esc(f.suggestedFix)}</div>` : ""}
|
|
87
89
|
${f.evidence && fs.existsSync(path.join(captureDir, f.evidence))
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
// Who actually crashed.
|
|
2
|
+
//
|
|
3
|
+
// The iOS harness reports `crash` when the app under test stops running mid-run. That is the
|
|
4
|
+
// right observation and the wrong attribution whenever a *simulator system process* died —
|
|
5
|
+
// SpringBoard respawning takes every foreground app with it — and xcodebuild prints the full
|
|
6
|
+
// system crash trace for any simulator-hosted process that dies, not just the app (public
|
|
7
|
+
// issue #30). The desktop app has had a cross-check against the real crash reports in
|
|
8
|
+
// ~/Library/Logs/DiagnosticReports since a false-CRITICAL incident in the field
|
|
9
|
+
// (ExplorationService.findRealCrashReport); this is that check for the CLI/MCP path.
|
|
10
|
+
//
|
|
11
|
+
// The rules are the ones verified against real reports there:
|
|
12
|
+
// - bundleID lives in the header for genuine app crashes, in the body for EXC_GUARD/XPC faults,
|
|
13
|
+
// and in bundleInfo.CFBundleIdentifier sometimes — check all three;
|
|
14
|
+
// - launch-throttle crash variants omit the bundle id entirely; a report whose procPath is in
|
|
15
|
+
// THIS simulator's user-app container is the app, unless it is the XCUITest runner, whose own
|
|
16
|
+
// death is instrumentation failure and never an app crash;
|
|
17
|
+
// - EXC_GUARD is not an app crash.
|
|
18
|
+
import fs from "fs";
|
|
19
|
+
import os from "os";
|
|
20
|
+
import path from "path";
|
|
21
|
+
|
|
22
|
+
export const DEFAULT_REPORTS_DIR = path.join(os.homedir(), "Library", "Logs", "DiagnosticReports");
|
|
23
|
+
export const ATTRIBUTION_FILE = "crash-attribution.json";
|
|
24
|
+
|
|
25
|
+
function parseIps(raw) {
|
|
26
|
+
const nl = raw.indexOf("\n");
|
|
27
|
+
if (nl < 0) return null;
|
|
28
|
+
let header; let body;
|
|
29
|
+
try { header = JSON.parse(raw.slice(0, nl)); } catch { return null; }
|
|
30
|
+
try { body = JSON.parse(raw.slice(nl + 1)); } catch { body = {}; }
|
|
31
|
+
if (!header || typeof header !== "object") return null;
|
|
32
|
+
return { header, body: body && typeof body === "object" ? body : {} };
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function classifyCrashReport({ header, body }, { bundleId, simulatorUdid } = {}) {
|
|
36
|
+
const matchedBundle = (typeof body.bundleID === "string" && body.bundleID)
|
|
37
|
+
|| (typeof header.bundleID === "string" && header.bundleID)
|
|
38
|
+
|| (body.bundleInfo && typeof body.bundleInfo.CFBundleIdentifier === "string" ? body.bundleInfo.CFBundleIdentifier : null)
|
|
39
|
+
|| null;
|
|
40
|
+
const procPath = typeof body.procPath === "string" ? body.procPath : "";
|
|
41
|
+
const procName = String(body.procName || header.name || header.app_name || "").trim();
|
|
42
|
+
const lower = procName.toLowerCase();
|
|
43
|
+
const isTestRunner = lower.endsWith("-runner") || procPath.includes("-Runner.app") || procPath.includes(".xctrunner");
|
|
44
|
+
const inOurSimulator = simulatorUdid ? procPath.includes(`/Devices/${simulatorUdid}/`) : false;
|
|
45
|
+
const inOurAppContainer = inOurSimulator && procPath.includes("/data/Containers/Bundle/Application/") && !isTestRunner;
|
|
46
|
+
const exceptionType = body.exception && typeof body.exception.type === "string" ? body.exception.type : null;
|
|
47
|
+
const isApp = bundleId ? (matchedBundle === bundleId || (matchedBundle == null && inOurAppContainer)) : inOurAppContainer;
|
|
48
|
+
return {
|
|
49
|
+
procName: procName || "(unknown process)",
|
|
50
|
+
bundleId: matchedBundle,
|
|
51
|
+
exceptionType,
|
|
52
|
+
isTestRunner,
|
|
53
|
+
inOurSimulator,
|
|
54
|
+
kind: isTestRunner ? "test-runner" : exceptionType === "EXC_GUARD" ? "guard-fault" : isApp ? "app" : inOurSimulator ? "simulator-system" : "other",
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Reports written at or after `since` (ms epoch), classified. ExcUserFault_* files are user-fault
|
|
59
|
+
// notices, not crashes.
|
|
60
|
+
export function findCrashReports({ since, bundleId, simulatorUdid, dir = DEFAULT_REPORTS_DIR } = {}) {
|
|
61
|
+
let names;
|
|
62
|
+
try { names = fs.readdirSync(dir); } catch { return { app: [], simulatorSystem: [], other: [] }; }
|
|
63
|
+
const out = { app: [], simulatorSystem: [], other: [] };
|
|
64
|
+
for (const name of names) {
|
|
65
|
+
if (!name.endsWith(".ips") || name.startsWith("ExcUserFault_")) continue;
|
|
66
|
+
const full = path.join(dir, name);
|
|
67
|
+
let stat;
|
|
68
|
+
try { stat = fs.statSync(full); } catch { continue; }
|
|
69
|
+
if (Number.isFinite(since) && stat.mtimeMs < since) continue;
|
|
70
|
+
let parsed;
|
|
71
|
+
try { parsed = parseIps(fs.readFileSync(full, "utf8")); } catch { continue; }
|
|
72
|
+
if (!parsed) continue;
|
|
73
|
+
const c = classifyCrashReport(parsed, { bundleId, simulatorUdid });
|
|
74
|
+
const entry = { path: full, modifiedAt: new Date(stat.mtimeMs).toISOString(), procName: c.procName, bundleId: c.bundleId, exceptionType: c.exceptionType };
|
|
75
|
+
if (c.kind === "app") out.app.push(entry);
|
|
76
|
+
else if (c.kind === "simulator-system") out.simulatorSystem.push(entry);
|
|
77
|
+
else if (c.kind === "other" || c.kind === "test-runner") out.other.push({ ...entry, kind: c.kind });
|
|
78
|
+
// guard faults are dropped: not a crash of anything
|
|
79
|
+
}
|
|
80
|
+
for (const list of Object.values(out)) list.sort((a, b) => a.modifiedAt.localeCompare(b.modifiedAt));
|
|
81
|
+
return out;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// Replace a raw crash trace in captured tool output with one line that says whose it was, so a
|
|
85
|
+
// SpringBoard trace does not read as the app under test blowing up. The full text stays in
|
|
86
|
+
// full-output.txt; this is for anything shown to a person or an agent.
|
|
87
|
+
const TRACE_START = /^(?:Crash Report|Process:\s+\S+\s+\[\d+\]|Incident Identifier:|-{10,}\s*$|Thread \d+ (?:Crashed|name):)/;
|
|
88
|
+
const TRACE_END = /^(?:Binary Images:|EOF|-{10,}\s*$)/;
|
|
89
|
+
export function summarizeCrashTraces(text = "") {
|
|
90
|
+
const lines = String(text).split(/\r?\n/);
|
|
91
|
+
const out = [];
|
|
92
|
+
let i = 0;
|
|
93
|
+
while (i < lines.length) {
|
|
94
|
+
const line = lines[i];
|
|
95
|
+
const looksLikeTrace = /^Process:\s+(\S+)\s+\[\d+\]/.test(line) || /^Crash Report/.test(line) || /quit unexpectedly/i.test(line);
|
|
96
|
+
if (!looksLikeTrace) { out.push(line); i += 1; continue; }
|
|
97
|
+
let proc = (line.match(/^Process:\s+(\S+)/) || line.match(/^(\S+) quit unexpectedly/i) || [])[1] || "";
|
|
98
|
+
let exc = "";
|
|
99
|
+
let j = i;
|
|
100
|
+
let consumed = 0;
|
|
101
|
+
for (; j < lines.length && consumed < 400; j += 1, consumed += 1) {
|
|
102
|
+
const l = lines[j];
|
|
103
|
+
if (!proc) proc = (l.match(/^Process:\s+(\S+)/) || [])[1] || proc;
|
|
104
|
+
if (!exc) exc = (l.match(/^Exception Type:\s+(.+)$/) || [])[1] || exc;
|
|
105
|
+
if (consumed > 2 && TRACE_END.test(l)) { j += 1; break; }
|
|
106
|
+
}
|
|
107
|
+
out.push(`[crash trace of ${proc || "a simulator process"}${exc ? ` — ${exc.trim()}` : ""} omitted here; full text in full-output.txt]`);
|
|
108
|
+
i = j;
|
|
109
|
+
}
|
|
110
|
+
return out.join("\n");
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// What a report consumer needs to decide: did the app crash, or did something else take it down?
|
|
114
|
+
export function attributeRunCrash({ since, bundleId, simulatorUdid, dir } = {}) {
|
|
115
|
+
const reports = findCrashReports({ since, bundleId, simulatorUdid, dir });
|
|
116
|
+
const verdict = reports.app.length
|
|
117
|
+
? "app"
|
|
118
|
+
: reports.simulatorSystem.length
|
|
119
|
+
? "simulator-system"
|
|
120
|
+
: reports.other.some((r) => r.kind === "test-runner")
|
|
121
|
+
? "test-runner"
|
|
122
|
+
: "no-report";
|
|
123
|
+
return { schemaVersion: 1, since: Number.isFinite(since) ? new Date(since).toISOString() : null, bundleId: bundleId || null, simulatorUdid: simulatorUdid || null, verdict, reports };
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export function writeAttribution(captureDir, attribution) {
|
|
127
|
+
fs.writeFileSync(path.join(captureDir, ATTRIBUTION_FILE), JSON.stringify(attribution, null, 2));
|
|
128
|
+
return path.join(captureDir, ATTRIBUTION_FILE);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export function readAttribution(captureDir) {
|
|
132
|
+
try { return JSON.parse(fs.readFileSync(path.join(captureDir, ATTRIBUTION_FILE), "utf8")); } catch { return null; }
|
|
133
|
+
}
|
package/mcp-server/src/report.js
CHANGED
|
@@ -150,9 +150,55 @@ export function observationSummary(report) {
|
|
|
150
150
|
|
|
151
151
|
// Turn a capture's OCQA markers into a scoreless observation with deduped findings and an
|
|
152
152
|
// explicit coverage floor. Release judgment is applied later by evaluateGate.
|
|
153
|
+
function readCrashAttribution(captureDir) {
|
|
154
|
+
try {
|
|
155
|
+
const parsed = JSON.parse(fs.readFileSync(path.join(captureDir, "crash-attribution.json"), "utf8"));
|
|
156
|
+
return parsed && typeof parsed === "object" && typeof parsed.verdict === "string" ? parsed : null;
|
|
157
|
+
} catch {
|
|
158
|
+
return null;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// The harness observes that the app stopped running; the crash reports say whose fault it was.
|
|
163
|
+
// A simulator system process (SpringBoard) dying takes the app with it, and the XCUITest runner
|
|
164
|
+
// dying is instrumentation failure — neither is a defect in the app under test, and reporting
|
|
165
|
+
// either as a critical app crash is the false CRITICAL the desktop app fixed in 0.16 (issue #30).
|
|
166
|
+
// With no report in the run window the harness observation stands, unverified and said so.
|
|
167
|
+
export function reattributeCrashes(findings, attribution) {
|
|
168
|
+
for (const f of findings) {
|
|
169
|
+
if (f.type !== "crash") continue;
|
|
170
|
+
const r = attribution.reports || {};
|
|
171
|
+
if (attribution.verdict === "app") {
|
|
172
|
+
const report = r.app?.[0];
|
|
173
|
+
if (report) {
|
|
174
|
+
f.crashReport = report.path;
|
|
175
|
+
if (report.exceptionType) f.title = `${f.title} (${report.exceptionType})`;
|
|
176
|
+
}
|
|
177
|
+
} else if (attribution.verdict === "simulator-system") {
|
|
178
|
+
const report = r.simulatorSystem?.[0] || {};
|
|
179
|
+
f.type = "simulator_system_crash";
|
|
180
|
+
f.category = "environment";
|
|
181
|
+
f.severity = "medium";
|
|
182
|
+
f.authority = "advisory";
|
|
183
|
+
f.crashReport = report.path || null;
|
|
184
|
+
f.title = `Simulator system process ${report.procName || "(unknown)"} crashed${report.exceptionType ? ` (${report.exceptionType})` : ""} and took the app with it — not attributed to the app under test`;
|
|
185
|
+
} else if (attribution.verdict === "test-runner") {
|
|
186
|
+
f.type = "test_runner_crash";
|
|
187
|
+
f.category = "environment";
|
|
188
|
+
f.severity = "medium";
|
|
189
|
+
f.authority = "advisory";
|
|
190
|
+
f.title = "The XCUITest runner died mid-run (instrumentation failure) — the app under test is not known to have crashed";
|
|
191
|
+
} else {
|
|
192
|
+
f.attributionNote = "no crash report was found for this run window; the harness observation stands unverified";
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
return findings;
|
|
196
|
+
}
|
|
197
|
+
|
|
153
198
|
export function buildQaReport(markersFilePath, { platform = "ios", target = null } = {}) {
|
|
154
199
|
const base = parseOcqaMarkers(markersFilePath);
|
|
155
200
|
if (!base) return null;
|
|
201
|
+
const crashAttribution = platform === "ios" ? readCrashAttribution(path.dirname(markersFilePath)) : null;
|
|
156
202
|
|
|
157
203
|
const raw = fs.readFileSync(markersFilePath, "utf8");
|
|
158
204
|
const rawIssues = [];
|
|
@@ -264,6 +310,7 @@ export function buildQaReport(markersFilePath, { platform = "ios", target = null
|
|
|
264
310
|
...(platform === "web" ? { evaluationTier: findingEvaluationTier(i, platform) } : {}),
|
|
265
311
|
});
|
|
266
312
|
}
|
|
313
|
+
if (crashAttribution) reattributeCrashes(findings, crashAttribution);
|
|
267
314
|
findings.sort((a, b) => severityRank(a.severity) - severityRank(b.severity));
|
|
268
315
|
|
|
269
316
|
const screensExplored = screens.size || base.uniqueScreens.length;
|
|
@@ -278,9 +325,9 @@ export function buildQaReport(markersFilePath, { platform = "ios", target = null
|
|
|
278
325
|
const high = findings.filter((f) => f.severity === "high").length;
|
|
279
326
|
const med = findings.filter((f) => f.severity === "medium").length;
|
|
280
327
|
const low = findings.filter((f) => f.severity === "low").length;
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
328
|
+
// Advisory-authority findings (an environment event re-attributed away from the app) are
|
|
329
|
+
// reported but never counted toward the gate's deterministic tally.
|
|
330
|
+
const verdictFindings = findings.filter((finding) => finding.authority !== "advisory" && (platform !== "web" || finding.evaluationTier !== "sampled"));
|
|
284
331
|
const verdictCrit = verdictFindings.filter((f) => f.severity === "critical").length;
|
|
285
332
|
const verdictHigh = verdictFindings.filter((f) => f.severity === "high").length;
|
|
286
333
|
const verdictMed = verdictFindings.filter((f) => f.severity === "medium").length;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aarwitz/tapp",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.26",
|
|
4
4
|
"mcpName": "io.github.aarwitz/tapp",
|
|
5
5
|
"description": "Let coding agents verify UI changes on real iOS, Android, and web surfaces, then enforce reviewed proof in deterministic CI.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"docs/application-model.md",
|
|
25
25
|
"docs/scenarios.md",
|
|
26
26
|
"mcp-server/src/",
|
|
27
|
+
"scripts/attribute-ios-crash.js",
|
|
27
28
|
"scripts/ci-gate.sh",
|
|
28
29
|
"scripts/compile-contract.js",
|
|
29
30
|
"scripts/compile-flow.js",
|
|
@@ -89,7 +90,7 @@
|
|
|
89
90
|
"mobile"
|
|
90
91
|
],
|
|
91
92
|
"scripts": {
|
|
92
|
-
"test": "node --test tests/report.test.js tests/regression.test.js tests/engine.test.js tests/project-config.test.js tests/application-model.test.js tests/ui-map.test.js tests/focused-navigation.test.js tests/task-runtime.test.js tests/release-contract.test.js tests/pr-selection.test.js tests/flow-runtime.test.js tests/web-explorer.test.js tests/web-session.test.js tests/web-link-audit.test.js tests/web-audit.test.js tests/capture-provenance.test.js tests/web-flow.test.js tests/scenario-runtime.test.js tests/android-driver.test.js tests/android-explorer.test.js tests/android-flow.test.js tests/android-primitives-protocol.test.js tests/managed-web.test.js tests/product-operations.test.js tests/browser-product.test.js tests/browser-onboarding.test.js tests/managed-operation.test.js tests/cloud-runner.test.js tests/ci-setup.test.js tests/ci-install.test.js tests/cli.test.js tests/mcp-workspace.test.js tests/action.test.js tests/package-surface.test.js tests/agent-surface.test.js tests/presentation-contract.test.js tests/landing-brand.test.js tests/ci-gate.test.js tests/ci-report.test.js tests/desktop-protocol.test.js tests/ios-flow-protocol.test.js tests/feedback-triage-0919.test.js vscode-extension/test/bridge.test.js",
|
|
93
|
+
"test": "node --test tests/report.test.js tests/regression.test.js tests/engine.test.js tests/project-config.test.js tests/application-model.test.js tests/ui-map.test.js tests/focused-navigation.test.js tests/task-runtime.test.js tests/release-contract.test.js tests/pr-selection.test.js tests/flow-runtime.test.js tests/web-explorer.test.js tests/web-session.test.js tests/web-link-audit.test.js tests/web-audit.test.js tests/capture-provenance.test.js tests/ios-crash-attribution.test.js tests/web-flow.test.js tests/scenario-runtime.test.js tests/android-driver.test.js tests/android-explorer.test.js tests/android-flow.test.js tests/android-primitives-protocol.test.js tests/managed-web.test.js tests/product-operations.test.js tests/browser-product.test.js tests/browser-onboarding.test.js tests/managed-operation.test.js tests/cloud-runner.test.js tests/ci-setup.test.js tests/ci-install.test.js tests/cli.test.js tests/mcp-workspace.test.js tests/action.test.js tests/package-surface.test.js tests/agent-surface.test.js tests/presentation-contract.test.js tests/landing-brand.test.js tests/ci-gate.test.js tests/ci-report.test.js tests/desktop-protocol.test.js tests/ios-flow-protocol.test.js tests/feedback-triage-0919.test.js vscode-extension/test/bridge.test.js",
|
|
93
94
|
"test:browser-journey": "node --test tests/browser-journey.test.js",
|
|
94
95
|
"test:browser-native": "TAPP_RUN_NATIVE_BROWSER=1 node --test tests/browser-native-journey.test.js"
|
|
95
96
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Called by quick-capture.sh after an iOS run whose markers contain a crash: decide from the real
|
|
3
|
+
// crash reports whether the app under test crashed or a simulator system process took it down,
|
|
4
|
+
// write crash-attribution.json into the capture, and print one line for the terminal.
|
|
5
|
+
//
|
|
6
|
+
// node scripts/attribute-ios-crash.js <capture-dir> <bundle-id> <simulator-udid> <run-start-epoch-seconds>
|
|
7
|
+
import path from "path";
|
|
8
|
+
import { fileURLToPath } from "url";
|
|
9
|
+
import { attributeRunCrash, writeAttribution } from "../mcp-server/src/ios-crash-attribution.js";
|
|
10
|
+
|
|
11
|
+
const [captureDir, bundleId, simulatorUdid, startSeconds] = process.argv.slice(2);
|
|
12
|
+
if (!captureDir || !bundleId) {
|
|
13
|
+
console.error(`usage: ${path.basename(fileURLToPath(import.meta.url))} <capture-dir> <bundle-id> [simulator-udid] [run-start-epoch-seconds]`);
|
|
14
|
+
process.exit(2);
|
|
15
|
+
}
|
|
16
|
+
// Reports can be written a few seconds after the process dies; look back a little before the run
|
|
17
|
+
// started so a crash at launch is not missed, and never miss one written after we checked.
|
|
18
|
+
const since = Number(startSeconds) > 0 ? Number(startSeconds) * 1000 - 15_000 : Date.now() - 3_600_000;
|
|
19
|
+
const attribution = attributeRunCrash({ since, bundleId, simulatorUdid: simulatorUdid || undefined });
|
|
20
|
+
writeAttribution(path.resolve(captureDir), attribution);
|
|
21
|
+
const r = attribution.reports;
|
|
22
|
+
const line = attribution.verdict === "app"
|
|
23
|
+
? `Crash attribution: ${bundleId} crashed (${r.app[0].exceptionType || "see report"}) — ${r.app[0].path}`
|
|
24
|
+
: attribution.verdict === "simulator-system"
|
|
25
|
+
? `Crash attribution: simulator system process ${r.simulatorSystem[0].procName} crashed (${r.simulatorSystem[0].exceptionType || "see report"}) and took the app with it — NOT attributed to ${bundleId}; ${r.simulatorSystem[0].path}`
|
|
26
|
+
: attribution.verdict === "test-runner"
|
|
27
|
+
? `Crash attribution: the XCUITest runner died (instrumentation failure, not ${bundleId})`
|
|
28
|
+
: `Crash attribution: no crash report found for this run window; the harness observation stands unverified`;
|
|
29
|
+
console.log(line);
|
package/scripts/quick-capture.sh
CHANGED
|
@@ -241,6 +241,7 @@ while [[ $# -gt 0 ]]; do
|
|
|
241
241
|
done
|
|
242
242
|
|
|
243
243
|
UDID=$(get_booted_sim)
|
|
244
|
+
RUN_START_TS=$(date +%s)
|
|
244
245
|
SIM_NAME=$(get_sim_name)
|
|
245
246
|
|
|
246
247
|
if [[ -z "$UDID" ]]; then
|
|
@@ -401,6 +402,12 @@ OCQA_COMPLETE:{\"actions\":0,\"states\":0,\"issues\":1,\"screens\":\"\",\"outcom
|
|
|
401
402
|
fi
|
|
402
403
|
echo "$OUTPUT" > "$CAPTURE_DIR/full-output.txt"
|
|
403
404
|
|
|
405
|
+
# A harness "crash" means the app stopped running; it does not say why. Cross-check the real
|
|
406
|
+
# crash reports so a SpringBoard death is not written up as the app's bug (issue #30).
|
|
407
|
+
if grep -q '"type":"crash"' "$CAPTURE_DIR/ocqa-markers.txt" 2>/dev/null; then
|
|
408
|
+
node "$PROJECT_ROOT/scripts/attribute-ios-crash.js" "$CAPTURE_DIR" "$APP_BUNDLE" "$UDID" "$RUN_START_TS" || true
|
|
409
|
+
fi
|
|
410
|
+
|
|
404
411
|
COMPLETE_LINE=$(grep "OCQA_COMPLETE" "$CAPTURE_DIR/ocqa-markers.txt" | tail -1 || true)
|
|
405
412
|
if [[ -n "$COMPLETE_LINE" ]]; then
|
|
406
413
|
echo ""
|
package/skills/tapp/SKILL.md
CHANGED
|
@@ -97,6 +97,16 @@ ids or visible labels, check `hittable`, tap a field before typing, and wait for
|
|
|
97
97
|
content. Use coordinates only as a last resort. End the session when finished.
|
|
98
98
|
|
|
99
99
|
Do not edit the app merely because testing found a defect unless the user also asked for a fix. State what the evidence proves and what remains untested.
|
|
100
|
-
|
|
100
|
+
|
|
101
|
+
## File feedback on tapp itself — don't just work around it
|
|
102
|
+
|
|
103
|
+
A rough edge in Tapp (not the app under test) deserves its own report, filed the moment you
|
|
104
|
+
notice — not after you've already found a workaround and moved on. Draft with `tapp_feedback` or
|
|
105
|
+
`npx -y @aarwitz/tapp@latest feedback "title"` (draft only; `submit:true` needs the user's OK, it's
|
|
106
|
+
public) whenever: documented/expected behavior doesn't match reality; the underlying platform
|
|
107
|
+
tooling (simulator/emulator/browser) crashes or hangs, not the app under test; you had to invent a
|
|
108
|
+
workaround to finish a straightforward task; a result reported `ok`/`inconclusive` but clearly
|
|
109
|
+
shouldn't have; or you're unsure whether something is a real app finding or a Tapp bug. One report
|
|
110
|
+
per issue; when unsure, file — a closed non-issue costs nothing, an unreported bug stays a bug.
|
|
101
111
|
|
|
102
112
|
Read [references/commands.md](references/commands.md) only for exact CLI/MCP syntax, Flow replay, credentials, or platform prerequisites.
|