@trawlme/cli 3.8.1 → 3.8.2

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.
@@ -36,12 +36,21 @@ export interface Run {
36
36
  }
37
37
  /**
38
38
  * Resolve a known anti-bot vendor (or auth) name from a worker `blockType`
39
- * string. Returns null when the run isn't blocked, or when it's blocked by
40
- * something other than a known vendor (e.g. `proxy-domain-gate`,
41
- * `rate_limited_per_host`) — those stay on the genuine-error path since we
42
- * can't honestly attribute them to a specific "no reliable bypass" wall.
39
+ * string. Returns null when the run succeeded, when there is no `blockType`
40
+ * signal at all, or when `blockType` names something other than a known
41
+ * vendor (e.g. `proxy-domain-gate`, `rate_limited_per_host`) — those stay on
42
+ * the genuine-error path since we can't honestly attribute them to a specific
43
+ * "no reliable bypass" wall.
44
+ *
45
+ * `blocked` is deliberately NOT consulted here (#177): it is a mid-run,
46
+ * attempt-level signal the worker only stamps on one envelope shape, so it
47
+ * reads `false` on the great majority of genuinely walled runs (the early-block
48
+ * throw path sets `blockType` but never `blocked` — 63 of 64 walled runs
49
+ * measured on prod). `status === true` wins instead: a run that ultimately
50
+ * returned data was not walled, even if an earlier tier's `blockType` stamp
51
+ * survived on the row.
43
52
  */
44
- export declare function detectWallVendor(run: Pick<Run, 'blocked' | 'blockType'>): string | null;
53
+ export declare function detectWallVendor(run: Pick<Run, 'status' | 'statusDetail' | 'blockType'>): string | null;
45
54
  /**
46
55
  * Autofix activity metadata — from the persisted ai_fix_end activity.
47
56
  * aiUsage (cost) is stripped server-side; all diagnostics are kept.
@@ -30,14 +30,31 @@ const WALL_VENDOR_PATTERNS = [
30
30
  ];
31
31
  /**
32
32
  * Resolve a known anti-bot vendor (or auth) name from a worker `blockType`
33
- * string. Returns null when the run isn't blocked, or when it's blocked by
34
- * something other than a known vendor (e.g. `proxy-domain-gate`,
35
- * `rate_limited_per_host`) — those stay on the genuine-error path since we
36
- * can't honestly attribute them to a specific "no reliable bypass" wall.
33
+ * string. Returns null when the run succeeded, when there is no `blockType`
34
+ * signal at all, or when `blockType` names something other than a known
35
+ * vendor (e.g. `proxy-domain-gate`, `rate_limited_per_host`) — those stay on
36
+ * the genuine-error path since we can't honestly attribute them to a specific
37
+ * "no reliable bypass" wall.
38
+ *
39
+ * `blocked` is deliberately NOT consulted here (#177): it is a mid-run,
40
+ * attempt-level signal the worker only stamps on one envelope shape, so it
41
+ * reads `false` on the great majority of genuinely walled runs (the early-block
42
+ * throw path sets `blockType` but never `blocked` — 63 of 64 walled runs
43
+ * measured on prod). `status === true` wins instead: a run that ultimately
44
+ * returned data was not walled, even if an earlier tier's `blockType` stamp
45
+ * survived on the row.
37
46
  */
38
47
  export function detectWallVendor(run) {
39
- if (run.blocked !== true || !run.blockType)
48
+ // A run that returned data was not walled. `status === true` is not the whole
49
+ // predicate: trawl_node flips a degraded-but-non-empty run to
50
+ // `status:false, statusDetail:'regression'` (scraps.service.js, #1112) via a
51
+ // patch that never clears `blockType` — so keying on `status` alone would
52
+ // print "no reliable bypass" next to "Regression: length N vs baseline M",
53
+ // which is the same contradiction this guard exists to remove.
54
+ if (run.status === true || run.statusDetail === 'regression')
40
55
  return null;
56
+ if (!run.blockType)
57
+ return null; // no signal at all
41
58
  for (const [pattern, label] of WALL_VENDOR_PATTERNS) {
42
59
  if (pattern.test(run.blockType))
43
60
  return label;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trawlme/cli",
3
- "version": "3.8.1",
3
+ "version": "3.8.2",
4
4
  "description": "Trawl CLI — manage scraps from the terminal",
5
5
  "type": "module",
6
6
  "bin": {