run402 4.164.2 → 4.165.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.
package/lib/errors.mjs
CHANGED
|
@@ -86,6 +86,13 @@ What this is:
|
|
|
86
86
|
group on its own. Setting a status takes the project's service key or a
|
|
87
87
|
principal with project.deploy; the anon key and a CI session can only read.
|
|
88
88
|
|
|
89
|
+
Test traffic (a request made with a Run402 test session, or one the function
|
|
90
|
+
marked with errors.markTest() from @run402/functions) is counted like any
|
|
91
|
+
other, and each sample says "test". A group met only by tests since it
|
|
92
|
+
opened is test_only ("[test only]"): it is announced on the project's feed
|
|
93
|
+
as error_fingerprints_observed_in_tests, never to the owner, until an
|
|
94
|
+
ordinary request meets it.
|
|
95
|
+
|
|
89
96
|
Filters (each maps 1:1 to a query param):
|
|
90
97
|
--project <project_id> Project to read (defaults to the active project)
|
|
91
98
|
--since <iso> Window start (ISO-8601). Default: 24h before --until
|
|
@@ -117,7 +124,9 @@ Quality tiers (fingerprint_quality):
|
|
|
117
124
|
message_only medium — grouped by normalized message
|
|
118
125
|
coarse no error detail, grouped by function, status, method and
|
|
119
126
|
route. coarse_reason says why: no_error_thrown (the function
|
|
120
|
-
answered the status itself
|
|
127
|
+
answered the status itself and reported no error; a function
|
|
128
|
+
that catches one passes it to errors.report(err) from
|
|
129
|
+
@run402/functions), or function_predates_side_channel
|
|
121
130
|
(redeploy it and future occurrences fingerprint at full
|
|
122
131
|
fidelity; the verdict's coverage line counts those functions).
|
|
123
132
|
|
|
@@ -627,14 +636,15 @@ export function renderListRow(row) {
|
|
|
627
636
|
const coarse = r.fingerprint_quality === "coarse" ? " [coarse]" : "";
|
|
628
637
|
const status = r.status && r.status !== "open" ? ` [${r.status}]` : "";
|
|
629
638
|
const reopened = r.status === "open" && Number(r.reopen_count ?? 0) > 0 ? " [reopened]" : "";
|
|
639
|
+
const testOnly = r.test_only === true ? " [test only]" : "";
|
|
630
640
|
const msg = truncate(r.message_template, 100);
|
|
631
|
-
return `${r.fingerprint_id} ${r.kind} ×${fmtInt(r.count)} ${r.error_name} fn:${r.function} "${msg}" · ${relativeTime(r.last_seen)}${coarse}${status}${reopened}`;
|
|
641
|
+
return `${r.fingerprint_id} ${r.kind} ×${fmtInt(r.count)} ${r.error_name} fn:${r.function} "${msg}" · ${relativeTime(r.last_seen)}${coarse}${status}${reopened}${testOnly}`;
|
|
632
642
|
}
|
|
633
643
|
|
|
634
644
|
/** Why a coarse row has no detail, as the gateway computed it (`coarse_reason`). */
|
|
635
645
|
function coarseExplanation(reason) {
|
|
636
646
|
if (reason === "no_error_thrown") {
|
|
637
|
-
return "The function answered this status itself
|
|
647
|
+
return "The function answered this status itself and reported no error, so there is no error detail. Read a sample's logs for why it answered so; a function that catches an error can pass it to errors.report(err) from @run402/functions.";
|
|
638
648
|
}
|
|
639
649
|
if (reason === "function_predates_side_channel") {
|
|
640
650
|
return "This function predates the error side-channel; redeploying it upgrades future fingerprint fidelity (frame-level grouping).";
|
|
@@ -707,6 +717,9 @@ export function renderHumanDetail(detail) {
|
|
|
707
717
|
if (d.route_pattern) parts.push(` route ${d.method ?? ""} ${d.route_pattern}`.trimEnd());
|
|
708
718
|
}
|
|
709
719
|
parts.push(` status ${d.status ?? "open"}${d.status_changed_at ? ` (since ${d.status_changed_at})` : ""}`);
|
|
720
|
+
if (d.test_only === true) {
|
|
721
|
+
parts.push(" test only every occurrence since it opened was test traffic; the owner is told when an ordinary request meets it");
|
|
722
|
+
}
|
|
710
723
|
if (d.resolved_in_release_id) parts.push(` resolved in ${d.resolved_in_release_id}`);
|
|
711
724
|
if (Number(d.reopen_count ?? 0) > 0) {
|
|
712
725
|
parts.push(` reopened ${fmtInt(d.reopen_count)}×, last ${d.reopened_at ?? "?"} (release ${d.reopened_in_release_id ?? "unknown"})`);
|
|
@@ -730,12 +743,12 @@ export function renderHumanDetail(detail) {
|
|
|
730
743
|
parts.push("");
|
|
731
744
|
parts.push("Samples — pinned first occurrence + recent ring (newest first):");
|
|
732
745
|
if (first?.id) {
|
|
733
|
-
parts.push(` first ${first.id} ${first.at ?? ""} (release ${first.release_id ?? "unknown"})`);
|
|
746
|
+
parts.push(` first ${first.id} ${first.at ?? ""} (release ${first.release_id ?? "unknown"})${first.test === true ? " [test]" : ""}`);
|
|
734
747
|
parts.push(` ${logsCommand(d.function, first.id)}`);
|
|
735
748
|
}
|
|
736
749
|
for (const s of recent) {
|
|
737
750
|
if (!s?.id) continue;
|
|
738
|
-
parts.push(` recent ${s.id} ${s.at ?? ""} (release ${s.release_id ?? "unknown"})`);
|
|
751
|
+
parts.push(` recent ${s.id} ${s.at ?? ""} (release ${s.release_id ?? "unknown"})${s.test === true ? " [test]" : ""}`);
|
|
739
752
|
parts.push(` ${logsCommand(d.function, s.id)}`);
|
|
740
753
|
}
|
|
741
754
|
|
package/lib/errors.test.mjs
CHANGED
|
@@ -149,6 +149,32 @@ test("renderListRow — id, kind, count, name, function, message, coarse marker"
|
|
|
149
149
|
assert.match(coarse, /\[coarse\]$/);
|
|
150
150
|
});
|
|
151
151
|
|
|
152
|
+
test("renderListRow — a group met only by tests says so", () => {
|
|
153
|
+
assert.match(renderListRow({ ...ROW, test_only: true }), /\[test only\]$/);
|
|
154
|
+
assert.doesNotMatch(renderListRow({ ...ROW, test_only: false }), /test only/);
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
test("renderHumanDetail — a test-only group and its test samples say so", () => {
|
|
158
|
+
const out = renderHumanDetail({
|
|
159
|
+
...ROW,
|
|
160
|
+
test_only: true,
|
|
161
|
+
samples: {
|
|
162
|
+
first: { id: "req_first", at: "2026-07-11T00:00:00Z", release_id: "rel_01JX", test: true },
|
|
163
|
+
recent: [{ id: "req_recent", at: "2026-07-12T11:57:00Z", release_id: "rel_01JX", test: false }],
|
|
164
|
+
},
|
|
165
|
+
});
|
|
166
|
+
assert.match(out, /test only\s+every occurrence since it opened was test traffic/);
|
|
167
|
+
assert.match(out, /first\s+req_first.*\[test\]/);
|
|
168
|
+
assert.doesNotMatch(out, /recent\s+req_recent.*\[test\]/);
|
|
169
|
+
assert.doesNotMatch(renderHumanDetail(ROW), /test only/);
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
test("renderHumanDetail — a coarse group with no error thrown points at errors.report", () => {
|
|
173
|
+
const out = renderHumanDetail({ ...ROW, fingerprint_quality: "coarse", coarse_reason: "no_error_thrown" });
|
|
174
|
+
assert.match(out, /reported no error/);
|
|
175
|
+
assert.match(out, /errors\.report\(err\)/);
|
|
176
|
+
});
|
|
177
|
+
|
|
152
178
|
test("renderHumanList — verdict first, then the gateway's drill-down command", () => {
|
|
153
179
|
const out = renderHumanList({ verdict: VERDICT, errors: [ROW], has_more: false });
|
|
154
180
|
const firstLine = out.split("\n", 1)[0];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "run402",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.165.0",
|
|
4
4
|
"description": "CLI for Run402 — full-stack backend infrastructure for AI agents: Postgres, auth, storage, serverless functions and atomic deploys. Paid with x402/MPP. Includes $0.03 image generation.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -28,8 +28,9 @@ export type ErrorKind = "uncaught" | "boot_crash" | "invoke_failed" | "handled_5
|
|
|
28
28
|
* How much signal a fingerprint's identity carries.
|
|
29
29
|
* - `frame_names` — full fidelity: ≥1 stable stack frame name survived.
|
|
30
30
|
* - `message_only` — normalized message template, no stable frames.
|
|
31
|
-
* - `coarse` — no error detail: the function answered 500 or above
|
|
32
|
-
*
|
|
31
|
+
* - `coarse` — no error detail: the function answered 500 or above and
|
|
32
|
+
* reported no error (it neither threw nor called `errors.report` from
|
|
33
|
+
* `@run402/functions`), or its bundle predates the error side-channel. Which one
|
|
33
34
|
* is the row's `coarse_reason`. A coarse row is keyed by its `method` and
|
|
34
35
|
* `route_pattern` when a route is known.
|
|
35
36
|
*/
|
|
@@ -73,6 +74,11 @@ export interface ErrorSample {
|
|
|
73
74
|
release_id: string | null;
|
|
74
75
|
/** The route the request matched (`/api/threads/[id]`, never the path), when one is known. */
|
|
75
76
|
route_pattern?: string;
|
|
77
|
+
/**
|
|
78
|
+
* True when the occurrence was test traffic: a request made with a Run402
|
|
79
|
+
* test session, or one the function marked with `errors.markTest()`.
|
|
80
|
+
*/
|
|
81
|
+
test: boolean;
|
|
76
82
|
[key: string]: unknown;
|
|
77
83
|
}
|
|
78
84
|
/**
|
|
@@ -121,6 +127,13 @@ export interface ErrorFingerprint {
|
|
|
121
127
|
/** A coarse row's route pattern (part of its identity); null when no route is known. */
|
|
122
128
|
route_pattern: string | null;
|
|
123
129
|
coarse_reason: CoarseReason | null;
|
|
130
|
+
/**
|
|
131
|
+
* True while every occurrence since the group last opened (its first
|
|
132
|
+
* sighting, or its latest reopening) was test traffic. Such a group is
|
|
133
|
+
* announced on the feed as `error_fingerprints_observed_in_tests`, never to
|
|
134
|
+
* the owner, until an ordinary request meets it.
|
|
135
|
+
*/
|
|
136
|
+
test_only: boolean;
|
|
124
137
|
samples: ErrorSamples;
|
|
125
138
|
next_actions: ErrorNextAction[];
|
|
126
139
|
[key: string]: unknown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.types.d.ts","sourceRoot":"","sources":["../../src/namespaces/errors.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,uDAAuD;AACvD,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,YAAY,GAAG,eAAe,GAAG,aAAa,CAAC;AAEpF
|
|
1
|
+
{"version":3,"file":"errors.types.d.ts","sourceRoot":"","sources":["../../src/namespaces/errors.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,uDAAuD;AACvD,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,YAAY,GAAG,eAAe,GAAG,aAAa,CAAC;AAEpF;;;;;;;;;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