@vzn/vx 0.0.348 → 0.0.349

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vzn/vx",
3
- "version": "0.0.348",
3
+ "version": "0.0.349",
4
4
  "description": "A fast, correct task runner and build cache for JavaScript monorepos.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -21,10 +21,10 @@
21
21
  "node": ">=18"
22
22
  },
23
23
  "optionalDependencies": {
24
- "@vzn/vx-linux-x64": "0.0.348",
25
- "@vzn/vx-linux-arm64": "0.0.348",
26
- "@vzn/vx-darwin-x64": "0.0.348",
27
- "@vzn/vx-darwin-arm64": "0.0.348"
24
+ "@vzn/vx-linux-x64": "0.0.349",
25
+ "@vzn/vx-linux-arm64": "0.0.349",
26
+ "@vzn/vx-darwin-x64": "0.0.349",
27
+ "@vzn/vx-darwin-arm64": "0.0.349"
28
28
  },
29
29
  "dependencies": {
30
30
  "@anthropic-ai/sandbox-runtime": "^0.0.76"
@@ -37,7 +37,7 @@ import {
37
37
  import { isGroupTask, RestoreDemoted, type TaskNode, type TaskOutcome } from '../graph/index.js'
38
38
  import { killGraceMs, maskedEmitter, printable, relPosix, secretMask, span } from '../util/index.js'
39
39
  import { SIGNAL_SHUTDOWN_GRACE_MS } from './signals.js'
40
- import { executorLabel } from './plugin-host.js'
40
+ import { executorLabel, nameExecutorFailure } from './plugin-host.js'
41
41
  import {
42
42
  mayWriteFingerprint,
43
43
  type Placeholder,
@@ -791,7 +791,8 @@ async function executeCachedTask(args: ExecuteArgs): Promise<TaskOutcome> {
791
791
  assertExecuteResult(args.executor.name, node.id, r)
792
792
  return r
793
793
  })
794
- .catch(async (err: unknown) => {
794
+ .catch(async (raw: unknown) => {
795
+ const err = nameExecutorFailure(args.executor, raw)
795
796
  const message = err instanceof Error ? err.message : String(err)
796
797
  log.taskStderr(node, `${message}\n`)
797
798
  await sweepPlaceholders(placeholders)
@@ -439,6 +439,23 @@ export async function resolveCache(
439
439
  /** The plugin each resolved executor came from, so a hook of it that throws is named. */
440
440
  const executorPlugin = new WeakMap<TaskExecutor, string>()
441
441
 
442
+ /**
443
+ * A plugin executor's throw from `execute`, named as every other hook's
444
+ * is: `plugin 'p' (executor 'e') failed in execute: …`. It read `internal
445
+ * error in <task>: pool down`, naming neither (C-63). The error itself is
446
+ * kept, its class, cause and code with it, so the scheduler still tells a
447
+ * refusal from a bug; the floor's own throw is vx's and stays as it is.
448
+ */
449
+ export function nameExecutorFailure(executor: TaskExecutor, err: unknown): unknown {
450
+ if (!(err instanceof Error) || !executorPlugin.has(executor)) return err
451
+ try {
452
+ err.message = `${executorLabel(executor)} failed in execute: ${err.message}`
453
+ } catch {
454
+ // A frozen error keeps its own words.
455
+ }
456
+ return err
457
+ }
458
+
442
459
  /** How a message names `executor`: its plugin and its own name, or its name alone (the floor). */
443
460
  export function executorLabel(executor: TaskExecutor): string {
444
461
  const plugin = executorPlugin.get(executor)