@boardwalk-labs/runner 0.2.7 → 0.2.8
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.
|
@@ -100,6 +100,18 @@ export function assertProgramRootOutsideWorkspace(programRoot, workspaceRoot) {
|
|
|
100
100
|
throw new AppError(ErrorCode.VALIDATION_FAILED, `The program root "${programRoot}" is inside the workspace "${workspaceRoot}"; the extracted program must live outside it.`);
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
|
+
/** An engine `EngineError` carries a one-line actionable `hint` alongside its message. It reaches us
|
|
104
|
+
* as a thrown value across the SDK/engine package boundary, so DUCK-TYPE it rather than `instanceof`
|
|
105
|
+
* (a dual-package copy of the class would defeat the check) — any thrown error carrying a non-empty
|
|
106
|
+
* string `hint` is surfaced. Without this the hint is dropped here, and on a hosted run there is no
|
|
107
|
+
* other place it could survive: the runner reports a failure as `{ code, message, hint? }` and the
|
|
108
|
+
* broker persists exactly that. */
|
|
109
|
+
function errorHint(err) {
|
|
110
|
+
if (typeof err !== "object" || err === null)
|
|
111
|
+
return undefined;
|
|
112
|
+
const hint = err.hint;
|
|
113
|
+
return typeof hint === "string" && hint !== "" ? hint : undefined;
|
|
114
|
+
}
|
|
103
115
|
/**
|
|
104
116
|
* Run a workflow program to completion. Installs the host + input, extracts the VERIFIED artifact +
|
|
105
117
|
* dynamic-imports its entry (which runs the body), and returns the terminal result. Always tears the
|
|
@@ -137,6 +149,10 @@ export async function runWorkflowProgram(args, deps) {
|
|
|
137
149
|
const redactText = deps.redactText ?? ((s) => s);
|
|
138
150
|
// Redact BEFORE both sinks: the message can carry a secret the program resolved then threw.
|
|
139
151
|
const message = redactText(err instanceof Error ? err.message : String(err));
|
|
152
|
+
// The hint is author-facing guidance ("write `builtins: [...]`"); redact it too — it is built from
|
|
153
|
+
// the same untrusted inputs as the message and could echo a resolved secret.
|
|
154
|
+
const rawHint = errorHint(err);
|
|
155
|
+
const hint = rawHint === undefined ? undefined : redactText(rawHint);
|
|
140
156
|
log.error("program_failed", { runId: args.runId, error: message });
|
|
141
157
|
return {
|
|
142
158
|
kind: "failed",
|
|
@@ -145,6 +161,7 @@ export async function runWorkflowProgram(args, deps) {
|
|
|
145
161
|
// `code` is the error class name (e.g. "Error", "AppError"), not user content — left as-is.
|
|
146
162
|
code: err instanceof Error ? err.name : "PROGRAM_ERROR",
|
|
147
163
|
message,
|
|
164
|
+
...(hint === undefined ? {} : { hint }),
|
|
148
165
|
},
|
|
149
166
|
};
|
|
150
167
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@boardwalk-labs/runner",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.8",
|
|
4
4
|
"description": "Boardwalk self-hosted runner: execute cloud-scheduled runs on your own machines. Currently: the canonical runner contract types.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|