@aarwitz/tapp 0.17.24 → 0.17.25
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 +5 -0
- package/bin/tapp.js +15 -1
- package/mcp-server/src/capture-provenance.js +77 -0
- package/mcp-server/src/index.js +36 -8
- package/mcp-server/src/report.js +10 -4
- package/mcp-server/src/web-audit.js +3 -1
- package/package.json +2 -2
- package/skills/tapp/SKILL.md +4 -0
|
@@ -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.25",
|
|
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.25",
|
|
28
28
|
"mcp"
|
|
29
29
|
],
|
|
30
30
|
"cwd": "${CLAUDE_PROJECT_DIR}"
|
package/AGENTS.md
CHANGED
|
@@ -210,5 +210,10 @@ without a coding agent, model, subscription, or API key. AI generation and `asse
|
|
|
210
210
|
of retrying variations.
|
|
211
211
|
- When you show a screenshot as proof, say what it proves and what it doesn't ("login works;
|
|
212
212
|
I haven't verified checkout").
|
|
213
|
+
- The capture a command returns is the evidence; `~/.tapp/captures/` holds every project's history.
|
|
214
|
+
Every capture carries `provenance.json` (kind, platform, target, project) and every result that
|
|
215
|
+
hands back a capture path hands back that record. `tapp_list_captures` and `tapp report latest`
|
|
216
|
+
are scoped to the current project; pass `allProjects:true` only when the user asks for history,
|
|
217
|
+
and never present another project's capture as this project's evidence or borrow it as a fixture.
|
|
213
218
|
- A clean `tapp_audit` means the page is served without structural defects. It says nothing about
|
|
214
219
|
behaviour, because nothing was clicked; never report it as "the site works".
|
package/bin/tapp.js
CHANGED
|
@@ -1233,6 +1233,10 @@ switch (command) {
|
|
|
1233
1233
|
const flowLog = path.join(tappHome, "flows", `${token}.log`);
|
|
1234
1234
|
const evidenceDir = path.join(tappHome, "captures", `flow-${platform}-${token}`);
|
|
1235
1235
|
fs.mkdirSync(path.dirname(flowLog), { recursive: true });
|
|
1236
|
+
{
|
|
1237
|
+
const { writeCaptureProvenance } = await import(path.join(packageRoot, "mcp-server", "src", "capture-provenance.js"));
|
|
1238
|
+
writeCaptureProvenance(evidenceDir, { kind: "flow", platform, target: path.relative(process.cwd(), absolute) || absolute });
|
|
1239
|
+
}
|
|
1236
1240
|
const env = { ...process.env, FLOW_LOG: flowLog, TAPP_FLOW_EVIDENCE_DIR: evidenceDir };
|
|
1237
1241
|
if (platform === "ios") {
|
|
1238
1242
|
const launch = iosLaunchOptions(flags, rest);
|
|
@@ -1445,6 +1449,10 @@ switch (command) {
|
|
|
1445
1449
|
const evidenceDir = path.join(tappHome, "captures", `scenario-web-${token}`);
|
|
1446
1450
|
const env = { ...process.env, FLOW_LOG: flowLog, TAPP_FLOW_EVIDENCE_DIR: evidenceDir };
|
|
1447
1451
|
const url = typeof flags.url === "string" ? flags.url : scenario.url || scenario.app || "";
|
|
1452
|
+
{
|
|
1453
|
+
const { writeCaptureProvenance } = await import(path.join(packageRoot, "mcp-server", "src", "capture-provenance.js"));
|
|
1454
|
+
writeCaptureProvenance(evidenceDir, { kind: "scenario", platform: "web", target: url || (path.relative(process.cwd(), absolute) || absolute) });
|
|
1455
|
+
}
|
|
1448
1456
|
const result = spawnSync(process.execPath, [path.join(packageRoot, "scripts", "run-web-scenario.js"), absolute, url], { stdio: "inherit", env });
|
|
1449
1457
|
if (fs.existsSync(flowLog)) spawnSync("python3", [path.join(packageRoot, "scripts", "flow_lib.py"), "report", flowLog], { stdio: "inherit" });
|
|
1450
1458
|
console.log(`\nEvidence: ${evidenceDir}`);
|
|
@@ -1993,7 +2001,13 @@ switch (command) {
|
|
|
1993
2001
|
// of those made `tapp report` fail even though valid exploration captures existed. An explicitly
|
|
1994
2002
|
// named capture is honored as-is so a non-exploration capture still gets a clear "no markers".
|
|
1995
2003
|
const explicit = rest[0] && rest[0] !== "latest";
|
|
1996
|
-
|
|
2004
|
+
// `latest` means this project's latest: the directory holds every project's captures, and
|
|
2005
|
+
// opening another project's evidence from here is exactly the mix-up issue #29 describes.
|
|
2006
|
+
// Falls back to any exploration capture only when none carries this project's provenance.
|
|
2007
|
+
const { readCaptureProvenance, captureBelongsToProject } = await import(path.join(packageRoot, "mcp-server", "src", "capture-provenance.js"));
|
|
2008
|
+
const ours = (dir) => captureBelongsToProject(readCaptureProvenance(dir), process.cwd());
|
|
2009
|
+
const wanted = explicit ? runs.find((r) => path.basename(r) === rest[0]) : (runs.find((r) => hasMarkers(r) && ours(r)) || runs.find(hasMarkers));
|
|
2010
|
+
if (!explicit && wanted && !ours(wanted)) console.log("ℹ️ No exploration capture carries this project's provenance; showing the newest capture on this machine — it may belong to another project.");
|
|
1997
2011
|
if (!wanted) {
|
|
1998
2012
|
bad("No captures found", explicit ? `no capture named "${rest[0]}"` : "run an exploration first (no capture with exploration markers was found)");
|
|
1999
2013
|
process.exit(1);
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
// Which project a capture belongs to.
|
|
2
|
+
//
|
|
3
|
+
// Every capture lands in the shared ~/.tapp/captures/, so an agent working in project A can
|
|
4
|
+
// see project B's history and, without anything telling it otherwise, present it as evidence
|
|
5
|
+
// (public issue #29: a Copilot session borrowed an unrelated capture as a "fixture"). Each
|
|
6
|
+
// capture now records who made it and from where, every result that hands back a capture path
|
|
7
|
+
// hands back this record with it, and listings default to the current project.
|
|
8
|
+
import fs from "fs";
|
|
9
|
+
import path from "path";
|
|
10
|
+
import { execFileSync } from "child_process";
|
|
11
|
+
import { createRequire } from "module";
|
|
12
|
+
|
|
13
|
+
const require = createRequire(import.meta.url);
|
|
14
|
+
const VERSION = (() => { try { return require("../../package.json").version; } catch { return "0.0.0"; } })();
|
|
15
|
+
|
|
16
|
+
export const PROVENANCE_FILE = "provenance.json";
|
|
17
|
+
|
|
18
|
+
function realpath(dir) {
|
|
19
|
+
try { return fs.realpathSync(dir); } catch { return path.resolve(dir); }
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// The git remote is the most stable project identity there is: it survives clones in different
|
|
23
|
+
// directories and is what a human means by "the project". Absent → the directory alone.
|
|
24
|
+
function gitRemote(dir) {
|
|
25
|
+
try {
|
|
26
|
+
return execFileSync("git", ["-C", dir, "config", "--get", "remote.origin.url"], { encoding: "utf8", stdio: ["ignore", "pipe", "ignore"], timeout: 2_000 }).trim() || null;
|
|
27
|
+
} catch {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function describeProject(projectDir = process.cwd()) {
|
|
33
|
+
const dir = realpath(projectDir);
|
|
34
|
+
return { dir, name: path.basename(dir), remote: gitRemote(dir) };
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// kind: explore | audit | flow | scenario | session. target: bundle id / app id / url / flow file.
|
|
38
|
+
export function writeCaptureProvenance(captureDir, { kind, platform, target = "", projectDir = process.cwd(), extra = {} } = {}) {
|
|
39
|
+
const record = {
|
|
40
|
+
schemaVersion: 1,
|
|
41
|
+
kind: String(kind || "capture"),
|
|
42
|
+
platform: String(platform || ""),
|
|
43
|
+
target: String(target || ""),
|
|
44
|
+
project: describeProject(projectDir),
|
|
45
|
+
tool: { name: "tapp", version: VERSION },
|
|
46
|
+
createdAt: new Date().toISOString(),
|
|
47
|
+
...extra,
|
|
48
|
+
};
|
|
49
|
+
fs.mkdirSync(captureDir, { recursive: true });
|
|
50
|
+
fs.writeFileSync(path.join(captureDir, PROVENANCE_FILE), JSON.stringify(record, null, 2));
|
|
51
|
+
return record;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function readCaptureProvenance(captureDir) {
|
|
55
|
+
try {
|
|
56
|
+
const parsed = JSON.parse(fs.readFileSync(path.join(captureDir, PROVENANCE_FILE), "utf8"));
|
|
57
|
+
return parsed && typeof parsed === "object" ? parsed : null;
|
|
58
|
+
} catch {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// Same remote, or same real directory. A capture with no record predates provenance and cannot
|
|
64
|
+
// be claimed by any project — callers show those separately rather than guessing.
|
|
65
|
+
export function captureBelongsToProject(provenance, projectDir = process.cwd()) {
|
|
66
|
+
if (!provenance?.project) return false;
|
|
67
|
+
const here = describeProject(projectDir);
|
|
68
|
+
if (provenance.project.remote && here.remote) return provenance.project.remote === here.remote;
|
|
69
|
+
return provenance.project.dir === here.dir;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// One line an agent can echo when it cites a capture, so the reader sees whose evidence it is.
|
|
73
|
+
export function provenanceLabel(provenance) {
|
|
74
|
+
if (!provenance) return "provenance unknown (capture predates tapp 0.17.25)";
|
|
75
|
+
const who = provenance.project?.remote || provenance.project?.dir || "unknown project";
|
|
76
|
+
return `${provenance.kind || "capture"} · ${provenance.platform || "?"} · ${provenance.target || "(no target)"} · from ${who}`;
|
|
77
|
+
}
|
package/mcp-server/src/index.js
CHANGED
|
@@ -29,6 +29,7 @@ const workspaceRoot = (() => {
|
|
|
29
29
|
catch { return path.resolve(process.cwd()); }
|
|
30
30
|
})();
|
|
31
31
|
const scriptsDir = path.join(repoRoot, "scripts");
|
|
32
|
+
import { writeCaptureProvenance, readCaptureProvenance, captureBelongsToProject, provenanceLabel } from "./capture-provenance.js";
|
|
32
33
|
// TAPP_HOME (set by the `tapp` CLI when installed) redirects writable output to a user directory.
|
|
33
34
|
// The old alias remains a read-only fallback; unset repository development stays local.
|
|
34
35
|
const tappHome = (process.env.TAPP_HOME || "").trim();
|
|
@@ -168,11 +169,14 @@ function listCaptureRuns(limit = 10) {
|
|
|
168
169
|
.map((d) => {
|
|
169
170
|
const full = path.join(capturesDir, d.name);
|
|
170
171
|
const stat = fs.statSync(full);
|
|
172
|
+
const provenance = readCaptureProvenance(full);
|
|
171
173
|
return {
|
|
172
174
|
id: d.name,
|
|
173
175
|
path: full,
|
|
174
176
|
relativePath: path.relative(repoRoot, full),
|
|
175
177
|
modifiedAt: stat.mtime.toISOString(),
|
|
178
|
+
provenance,
|
|
179
|
+
thisProject: captureBelongsToProject(provenance, workspaceRoot),
|
|
176
180
|
};
|
|
177
181
|
})
|
|
178
182
|
.sort((a, b) => (a.modifiedAt < b.modifiedAt ? 1 : -1));
|
|
@@ -180,6 +184,19 @@ function listCaptureRuns(limit = 10) {
|
|
|
180
184
|
return entries.slice(0, Math.max(1, limit));
|
|
181
185
|
}
|
|
182
186
|
|
|
187
|
+
// The captures directory is shared by every project on the machine. The agent-facing listing
|
|
188
|
+
// shows this project's captures only; other projects' captures and captures made before
|
|
189
|
+
// provenance existed are counted, not shown, so an agent never mistakes another project's
|
|
190
|
+
// history for evidence of this one (issue #29). Internal callers that diff "before/after" to find
|
|
191
|
+
// a capture a command just created keep the unfiltered list above.
|
|
192
|
+
function listProjectCaptures(limit = 10, { allProjects = false } = {}) {
|
|
193
|
+
const all = listCaptureRuns(1000);
|
|
194
|
+
const hiddenUnknown = allProjects ? 0 : all.filter((e) => !e.provenance).length;
|
|
195
|
+
const hiddenOtherProjects = allProjects ? 0 : all.filter((e) => e.provenance && !e.thisProject).length;
|
|
196
|
+
const visible = allProjects ? all : all.filter((e) => e.thisProject);
|
|
197
|
+
return { captures: visible.slice(0, Math.max(1, limit)), hiddenOtherProjects, hiddenUnknown };
|
|
198
|
+
}
|
|
199
|
+
|
|
183
200
|
function summarizeCapture(runPath) {
|
|
184
201
|
if (!fs.existsSync(runPath)) {
|
|
185
202
|
return null;
|
|
@@ -191,9 +208,12 @@ function summarizeCapture(runPath) {
|
|
|
191
208
|
? fs.readdirSync(screenshotsDir).filter((f) => f.endsWith(".png") || f.endsWith(".jpg") || f.endsWith(".jpeg")).length
|
|
192
209
|
: 0;
|
|
193
210
|
|
|
211
|
+
const provenance = readCaptureProvenance(runPath);
|
|
194
212
|
return {
|
|
195
213
|
path: runPath,
|
|
196
214
|
relativePath: path.relative(repoRoot, runPath),
|
|
215
|
+
provenance,
|
|
216
|
+
thisProject: captureBelongsToProject(provenance, workspaceRoot),
|
|
197
217
|
hasMarkers: files.includes("ocqa-markers.txt"),
|
|
198
218
|
hasFullOutput: files.includes("full-output.txt"),
|
|
199
219
|
hasUITree: files.includes("uitree.json"),
|
|
@@ -1903,6 +1923,7 @@ export async function runQaWeb({ url, maxActions, timeout, testEmail, testPasswo
|
|
|
1903
1923
|
const timeoutSec = Math.max(30, Math.min(3600, asInteger(timeout, 600)));
|
|
1904
1924
|
const id = "web-" + new Date().toISOString().replace(/[-:T]/g, "").slice(0, 14).replace(/^(\d{8})/, "$1-");
|
|
1905
1925
|
const outDir = path.join(capturesDir, id);
|
|
1926
|
+
const provenance = writeCaptureProvenance(outDir, { kind: "explore", platform: "web", target: url.trim(), projectDir: workspaceRoot });
|
|
1906
1927
|
let webResult;
|
|
1907
1928
|
try {
|
|
1908
1929
|
const { exploreWeb } = await import("./web-explorer.js");
|
|
@@ -1937,7 +1958,7 @@ export async function runQaWeb({ url, maxActions, timeout, testEmail, testPasswo
|
|
|
1937
1958
|
const { writeHtmlReport } = await import("./html-report.js");
|
|
1938
1959
|
reportHtml = writeHtmlReport(outDir, { report, label: url.trim() });
|
|
1939
1960
|
} catch { /* evidence page is best-effort */ }
|
|
1940
|
-
const structured = { ...report, regression, platform: "web", uiMap, reportHtml, exploration: { seedRoutes: webResult.seedRoutes || [], targets: webResult.seedTargets || [] }, capture: { id, path: outDir, relativePath: path.relative(repoRoot, outDir) } };
|
|
1961
|
+
const structured = { ...report, regression, platform: "web", uiMap, reportHtml, exploration: { seedRoutes: webResult.seedRoutes || [], targets: webResult.seedTargets || [] }, capture: { id, path: outDir, relativePath: path.relative(repoRoot, outDir), provenance } };
|
|
1941
1962
|
const text = formatQaReport(report, { regression, bundleId: url.trim(), aiConfigured: !!backend, reportHtml, uiMap: uiMap.error ? null : uiMap, surface });
|
|
1942
1963
|
return { structured, text };
|
|
1943
1964
|
}
|
|
@@ -1950,6 +1971,7 @@ export async function runQaAndroid({ appId, apkPath, serial, maxActions, timeout
|
|
|
1950
1971
|
const timeoutSec = Math.max(30, Math.min(3600, asInteger(timeout, 600)));
|
|
1951
1972
|
const id = "android-" + new Date().toISOString().replace(/[-:T]/g, "").slice(0, 14).replace(/^(\d{8})/, "$1-");
|
|
1952
1973
|
const outDir = path.join(capturesDir, id);
|
|
1974
|
+
const provenance = writeCaptureProvenance(outDir, { kind: "explore", platform: "android", target: appId.trim(), projectDir: workspaceRoot });
|
|
1953
1975
|
let androidResult;
|
|
1954
1976
|
try {
|
|
1955
1977
|
const { exploreAndroid } = await import("./android-explorer.js");
|
|
@@ -1983,7 +2005,7 @@ export async function runQaAndroid({ appId, apkPath, serial, maxActions, timeout
|
|
|
1983
2005
|
const { writeHtmlReport } = await import("./html-report.js");
|
|
1984
2006
|
reportHtml = writeHtmlReport(outDir, { report, label: appId.trim() });
|
|
1985
2007
|
} catch {}
|
|
1986
|
-
const structured = { ...report, regression, platform: "android", uiMap, reportHtml, exploration: { targets: androidResult.seedTargets || [] }, capture: { id, path: outDir, relativePath: path.relative(repoRoot, outDir) } };
|
|
2008
|
+
const structured = { ...report, regression, platform: "android", uiMap, reportHtml, exploration: { targets: androidResult.seedTargets || [] }, capture: { id, path: outDir, relativePath: path.relative(repoRoot, outDir), provenance } };
|
|
1987
2009
|
const text = formatQaReport(report, { regression, bundleId: appId.trim(), aiConfigured: !!backend, reportHtml, uiMap: uiMap.error ? null : uiMap, surface });
|
|
1988
2010
|
return { structured, text };
|
|
1989
2011
|
}
|
|
@@ -2006,6 +2028,7 @@ export async function runQaIos({ bundleId, maxActions, timeout, args = {}, surfa
|
|
|
2006
2028
|
|
|
2007
2029
|
const { created, timedOut, captureStderr } = await runExploreStreaming(bundleId, actions, timeoutSec, env, onProgress);
|
|
2008
2030
|
if (!created) return { error: "Exploration produced no capture run", details: { timedOut } };
|
|
2031
|
+
const provenance = writeCaptureProvenance(created.path, { kind: "explore", platform: "ios", target: bundleId, projectDir: workspaceRoot });
|
|
2009
2032
|
|
|
2010
2033
|
const report = buildQaReport(path.join(created.path, "ocqa-markers.txt"), { platform: "ios", target: bundleId });
|
|
2011
2034
|
if (!report) {
|
|
@@ -2053,7 +2076,7 @@ export async function runQaIos({ bundleId, maxActions, timeout, args = {}, surfa
|
|
|
2053
2076
|
reportHtml,
|
|
2054
2077
|
recording,
|
|
2055
2078
|
recordingWarning,
|
|
2056
|
-
capture: { id: created.id, path: created.path, relativePath: created.relativePath },
|
|
2079
|
+
capture: { id: created.id, path: created.path, relativePath: created.relativePath, provenance },
|
|
2057
2080
|
timedOut,
|
|
2058
2081
|
autoBooted: sim.autoBooted || false,
|
|
2059
2082
|
};
|
|
@@ -2714,7 +2737,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
|
2714
2737
|
{
|
|
2715
2738
|
name: "tapp_list_captures",
|
|
2716
2739
|
title: "List captures",
|
|
2717
|
-
description: "List recent capture runs from
|
|
2740
|
+
description: "List recent capture runs for THIS project (the workspace the server runs in). The captures directory is shared by every project on the machine; other projects' captures and pre-provenance captures are counted but hidden unless allProjects is true. Each entry carries provenance {kind, platform, target, project}. Use the capture a command just returned as evidence; never cite a capture from another project as if it were this one.",
|
|
2718
2741
|
inputSchema: {
|
|
2719
2742
|
type: "object",
|
|
2720
2743
|
properties: {
|
|
@@ -2724,6 +2747,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
|
2724
2747
|
maximum: 100,
|
|
2725
2748
|
default: 10,
|
|
2726
2749
|
},
|
|
2750
|
+
allProjects: { type: "boolean", default: false, description: "Include captures from other projects and captures without provenance — only when the user explicitly asks for historical evidence" },
|
|
2727
2751
|
},
|
|
2728
2752
|
},
|
|
2729
2753
|
},
|
|
@@ -3620,16 +3644,20 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
3620
3644
|
if (limit < 1 || limit > 100) {
|
|
3621
3645
|
return errorResult("limit must be between 1 and 100", { received: limit });
|
|
3622
3646
|
}
|
|
3623
|
-
const
|
|
3624
|
-
const
|
|
3647
|
+
const allProjects = args.allProjects === true;
|
|
3648
|
+
const { captures, hiddenOtherProjects, hiddenUnknown } = listProjectCaptures(limit, { allProjects });
|
|
3649
|
+
const L = [`🗂️ Found **${captures.length}** capture run${captures.length === 1 ? "" : "s"}${allProjects ? " across all projects" : ` for this project (${path.basename(workspaceRoot)})`}`];
|
|
3625
3650
|
if (captures.length) {
|
|
3626
3651
|
L.push("");
|
|
3627
3652
|
for (const c of captures.slice(0, 12)) {
|
|
3628
|
-
L.push(`- \`${c.id}\` · ${c.
|
|
3653
|
+
L.push(`- \`${c.id}\` · ${provenanceLabel(c.provenance)}`);
|
|
3629
3654
|
}
|
|
3630
3655
|
if (captures.length > 12) L.push(`- …and ${captures.length - 12} more`);
|
|
3631
3656
|
}
|
|
3632
|
-
|
|
3657
|
+
if (hiddenOtherProjects || hiddenUnknown) {
|
|
3658
|
+
L.push("", `Not shown: ${hiddenOtherProjects} capture(s) from other projects${hiddenUnknown ? ` and ${hiddenUnknown} with no provenance (made before tapp 0.17.25)` : ""}. They are not evidence of this project; pass allProjects:true only when the user asks for historical captures.`);
|
|
3659
|
+
}
|
|
3660
|
+
return richResult(L.join("\n"), { captures, hiddenOtherProjects, hiddenUnknown, project: path.basename(workspaceRoot) });
|
|
3633
3661
|
}
|
|
3634
3662
|
|
|
3635
3663
|
if (name === "tapp_capture_summary") {
|
package/mcp-server/src/report.js
CHANGED
|
@@ -512,14 +512,20 @@ export function computeContentCollapse(currentCounts, baselineCounts) {
|
|
|
512
512
|
// vanishing from the same-budget exploration usually means navigation regressed (a dead
|
|
513
513
|
// back button trapping the explorer, a broken link, a crash short-circuiting a flow).
|
|
514
514
|
// Found via subtle-bug seeding: a dead back button stranded the run on one screen and
|
|
515
|
-
// SHIP-READY passed with 3 of 6 baseline screens missing.
|
|
516
|
-
//
|
|
517
|
-
//
|
|
515
|
+
// SHIP-READY passed with 3 of 6 baseline screens missing. Two guards keep it honest:
|
|
516
|
+
// - a comparable action budget (≥60% of baseline actions), so a legit short run doesn't spray
|
|
517
|
+
// false losses;
|
|
518
|
+
// - a real collapse (fewer than 60% of the baseline's screens reached). Exploration order is not
|
|
519
|
+
// deterministic, and at a small budget a run routinely reaches 6 of 7 screens one time and a
|
|
520
|
+
// different 6 the next; that is variance, not a regression. The hosted iOS gate went red on
|
|
521
|
+
// exactly that (one of seven DemoApp screens unreached at 16 actions) on 2026-10-08.
|
|
518
522
|
export function computeReachabilityLoss(current, baseline) {
|
|
519
|
-
if (!current?.screens || !baseline?.screens) return [];
|
|
523
|
+
if (!current?.screens || !baseline?.screens || !baseline.screens.length) return [];
|
|
520
524
|
const baseActions = baseline.actionsPerformed || 0;
|
|
521
525
|
if (baseActions > 0 && (current.actionsPerformed || 0) < baseActions * 0.6) return [];
|
|
522
526
|
const reached = new Set(current.screens);
|
|
527
|
+
const reachedBaseline = baseline.screens.filter((s) => reached.has(s)).length;
|
|
528
|
+
if (reachedBaseline >= baseline.screens.length * 0.6) return [];
|
|
523
529
|
return baseline.screens
|
|
524
530
|
.filter((s) => !reached.has(s))
|
|
525
531
|
.map((screen) => ({
|
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
import { buildQaReport } from "./report.js";
|
|
21
21
|
import { writeHtmlReport } from "./html-report.js";
|
|
22
22
|
import { buildUiMapFromMarkers, writeUiMap } from "./ui-map.js";
|
|
23
|
+
import { writeCaptureProvenance } from "./capture-provenance.js";
|
|
23
24
|
|
|
24
25
|
const require = createRequire(import.meta.url);
|
|
25
26
|
const VERSION = (() => { try { return require("../../package.json").version; } catch { return "0.0.0"; } })();
|
|
@@ -322,6 +323,7 @@ export async function auditWebSite({
|
|
|
322
323
|
const { chromium, devices } = await loadPlaywright();
|
|
323
324
|
const browser = await chromium.launch(webBrowserLaunchOptions(process.env, {}));
|
|
324
325
|
const capture = capturesDir ? openCapture(capturesDir, captureId || auditCaptureId()) : null;
|
|
326
|
+
const provenance = capture ? writeCaptureProvenance(capture.dir, { kind: "audit", platform: "web", target: start.href }) : null;
|
|
325
327
|
try {
|
|
326
328
|
const contextOptions = webContextOptions({ device, viewport, devices });
|
|
327
329
|
// Identify ourselves to sites we do not own; the default UA is kept so rendering is unchanged.
|
|
@@ -396,7 +398,7 @@ export async function auditWebSite({
|
|
|
396
398
|
};
|
|
397
399
|
if (capture) {
|
|
398
400
|
finalizeCapture(capture, { startUrl: start.href, pages: results, findings, robotsBlocked, linksChecked: { total: linksTotal, checked: linksChecked } });
|
|
399
|
-
summary.capture = { id: capture.id, path: capture.dir, report: path.join(capture.dir, "report.html") };
|
|
401
|
+
summary.capture = { id: capture.id, path: capture.dir, report: path.join(capture.dir, "report.html"), provenance };
|
|
400
402
|
fs.writeFileSync(path.join(capture.dir, "audit.json"), JSON.stringify(summary, null, 2));
|
|
401
403
|
}
|
|
402
404
|
return summary;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aarwitz/tapp",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.25",
|
|
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",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"mobile"
|
|
90
90
|
],
|
|
91
91
|
"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/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",
|
|
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
93
|
"test:browser-journey": "node --test tests/browser-journey.test.js",
|
|
94
94
|
"test:browser-native": "TAPP_RUN_NATIVE_BROWSER=1 node --test tests/browser-native-journey.test.js"
|
|
95
95
|
}
|
package/skills/tapp/SKILL.md
CHANGED
|
@@ -77,6 +77,10 @@ ship verdict. Report:
|
|
|
77
77
|
- each important finding and its evidence/report path;
|
|
78
78
|
- what Tapp explicitly did not check.
|
|
79
79
|
|
|
80
|
+
Evidence is the capture the command just returned. `~/.tapp/captures/` is shared by every project on
|
|
81
|
+
the machine; `tapp_list_captures` shows only this project's and labels each with its provenance. Never
|
|
82
|
+
cite or reuse another project's capture, and never borrow one as a fixture — make a fresh one.
|
|
83
|
+
|
|
80
84
|
If `inconclusive: true`, explain the blocker. A login wall or missing test data is not a pass. Ask for
|
|
81
85
|
credentials or launch configuration instead of rerunning blindly. Do not infer content accuracy,
|
|
82
86
|
privacy, brand consistency, or business guarantees from a generic crawl; those require a reviewed
|