@vzn/vx 0.0.639 → 0.0.641

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.
Files changed (88) hide show
  1. package/README.md +1 -1
  2. package/docs/caching.md +158 -106
  3. package/docs/cli.md +80 -45
  4. package/docs/execution.md +11 -10
  5. package/docs/features.md +9 -8
  6. package/docs/patterns.md +1 -1
  7. package/docs/schema.md +252 -190
  8. package/docs/security.md +5 -4
  9. package/launcher.sh +9 -2
  10. package/package.json +5 -5
  11. package/schemas/show.json +14 -14
  12. package/skills/vx/SKILL.md +4 -3
  13. package/src/bin.ts +8 -6
  14. package/src/cache/archive.ts +248 -41
  15. package/src/cache/cache.ts +46 -19
  16. package/src/cache/file-hashes.ts +7 -12
  17. package/src/cache/fs-clock.ts +62 -0
  18. package/src/cache/git-inputs.ts +2 -2
  19. package/src/cache/index.ts +6 -0
  20. package/src/cache/inputs.ts +228 -111
  21. package/src/cache/key-fold.ts +23 -3
  22. package/src/cache/layer.ts +15 -8
  23. package/src/cache/layered-cache.ts +8 -7
  24. package/src/cache/linked-inputs.ts +87 -0
  25. package/src/cache/scoped-cache.ts +8 -2
  26. package/src/cli/foreign-flags.ts +1 -1
  27. package/src/cli/help.ts +7 -1
  28. package/src/cli/init.ts +23 -11
  29. package/src/cli/last.ts +24 -1
  30. package/src/cli/plugin-templates.ts +2 -2
  31. package/src/cli/select.ts +16 -6
  32. package/src/cli/show.ts +9 -6
  33. package/src/cli/upgrade.ts +132 -21
  34. package/src/cli/watch-filter.ts +23 -12
  35. package/src/cli/watch-fs.ts +2 -1
  36. package/src/cli/watch-judge.ts +49 -5
  37. package/src/cli/watch-set.ts +18 -8
  38. package/src/cli/watch.ts +74 -2
  39. package/src/cli/why.ts +5 -3
  40. package/src/config.ts +19 -15
  41. package/src/exec/executor.ts +4 -4
  42. package/src/graph/dependency-spec.ts +2 -2
  43. package/src/graph/folds.ts +236 -0
  44. package/src/graph/index.ts +8 -1
  45. package/src/graph/scheduler.ts +41 -15
  46. package/src/graph/task-graph.ts +135 -73
  47. package/src/handoff.ts +5 -0
  48. package/src/index.ts +2 -2
  49. package/src/orchestrator/affected-tasks.ts +20 -19
  50. package/src/orchestrator/download-policy.ts +16 -22
  51. package/src/orchestrator/excluded-keys.ts +4 -5
  52. package/src/orchestrator/execute-task.ts +29 -25
  53. package/src/orchestrator/hit-restore.ts +101 -27
  54. package/src/orchestrator/index.ts +1 -0
  55. package/src/orchestrator/keyed-projects.ts +12 -51
  56. package/src/orchestrator/local-shortcircuit.ts +9 -1
  57. package/src/orchestrator/persistent-task.ts +3 -3
  58. package/src/orchestrator/placement.ts +2 -2
  59. package/src/orchestrator/plan.ts +1 -1
  60. package/src/orchestrator/plugin-host.ts +66 -27
  61. package/src/orchestrator/plugin.ts +12 -2
  62. package/src/orchestrator/prepare.ts +12 -5
  63. package/src/orchestrator/projects.ts +7 -10
  64. package/src/orchestrator/run-report.ts +145 -46
  65. package/src/orchestrator/run-steps.ts +57 -0
  66. package/src/orchestrator/run.ts +76 -44
  67. package/src/orchestrator/sandbox-fix.ts +1 -1
  68. package/src/orchestrator/sandbox-request.ts +2 -2
  69. package/src/orchestrator/stable-keys.ts +59 -26
  70. package/src/orchestrator/steps.ts +26 -6
  71. package/src/orchestrator/task-hash.ts +31 -9
  72. package/src/orchestrator/telemetry-host.ts +3 -3
  73. package/src/orchestrator/telemetry.ts +9 -4
  74. package/src/orchestrator/upstream.ts +4 -181
  75. package/src/report/framed-output.ts +1 -1
  76. package/src/report/logger.ts +5 -2
  77. package/src/report/status-line.ts +7 -3
  78. package/src/report/summary.ts +6 -4
  79. package/src/settings.ts +11 -17
  80. package/src/util/index.ts +3 -0
  81. package/src/util/paths.ts +39 -5
  82. package/src/workspace/affected.ts +81 -2
  83. package/src/workspace/config-eval.ts +2 -2
  84. package/src/workspace/config-imports.ts +1 -1
  85. package/src/workspace/config-schema.ts +142 -143
  86. package/src/workspace/lockfile.ts +1 -1
  87. package/src/workspace/migration.ts +19 -3
  88. package/src/workspace/project-loader.ts +5 -4
@@ -67,7 +67,7 @@ const QUOTE_ARGS =
67
67
  `vx_r="$vx_r\${vx_s%%"$vx_q"*}'\\''"; vx_s=\${vx_s#*"$vx_q"};; *) break;; esac; done; ` +
68
68
  `vx_a="$vx_a '$vx_r$vx_s'"; done`
69
69
 
70
- const isCacheTodo = (todo: string): boolean => todo.startsWith('cache: add `cache: {')
70
+ const isCacheTodo = (todo: string): boolean => todo.startsWith('cache: add `inputs: {')
71
71
 
72
72
  /** The one wording every mapper emits for a task it made persistent. */
73
73
  export const PERSISTENT_TODO =
@@ -426,7 +426,7 @@ export async function applyMigration(args: ApplyMigrationArgs): Promise<number>
426
426
  }
427
427
 
428
428
  // The lock's own words become a row; a refusal prints above the report.
429
- const lock = dry || args.lock === undefined ? undefined : await args.lock(root)
429
+ const lock = dry || args.lock === undefined ? undefined : lockAnswer(await args.lock(root))
430
430
  if (lock !== undefined && lock.code !== 0) process.stderr.write(lock.said)
431
431
 
432
432
  const rows: ui.FieldRow[] = [['from', source]]
@@ -488,6 +488,22 @@ export async function applyMigration(args: ApplyMigrationArgs): Promise<number>
488
488
  return 0
489
489
  }
490
490
 
491
+ /**
492
+ * The lock step's answer, checked: the tool calling this seam is another
493
+ * package and may be another version (vx-migrate 0.0.637's answered its
494
+ * exit code, which crashed the report).
495
+ */
496
+ function lockAnswer(answer: unknown): { code: number; said: string } {
497
+ const a = answer as { code?: unknown; said?: unknown } | null
498
+ if (
499
+ typeof a === 'object' &&
500
+ a !== null &&
501
+ typeof a.code === 'number' &&
502
+ typeof a.said === 'string'
503
+ )
504
+ return { code: a.code, said: a.said }
505
+ return { code: 1, said: 'vx lock: the migration tool answered no result: run `vx lock`\n' }
506
+ }
491
507
  /**
492
508
  * What to do about written files .gitignore drops. A `!file` line cures a
493
509
  * file, but git re-includes nothing inside an ignored directory: an
@@ -624,7 +640,7 @@ const EXAMPLE_BODY = `export default {
624
640
  build: {
625
641
  exec: { command: 'tsc -b' },
626
642
  dependsOn: ['^build'],
627
- cache: { inputs: { files: ['src/**'] }, outputs: { files: ['dist/**'] } },
643
+ inputs: { files: ['src/**'] }, cache: { outputs: { files: ['dist/**'] } },
628
644
  },
629
645
  },
630
646
  }`
@@ -75,8 +75,9 @@ let serving = false
75
75
  const HELD_QUERY = /\?vx-(?:held|literal)=([0-9a-f]+)$/
76
76
 
77
77
  // Bun's resolver reads `\` as a separator, even in a file: URL, so a
78
- // config under `a\b` was looked for under `a/b`. Resolving it here keeps
79
- // the path as written; only the served load can take it.
78
+ // config under `a\b` was looked for under `a/b`, and `?` as a query, so
79
+ // one under `a?b` was looked for under `a`. Resolving it here keeps the
80
+ // path as written; only the served load can take it.
80
81
  const LITERAL_QUERY = /\?vx-literal=[0-9a-f]+$/
81
82
 
82
83
  function serveHeldSources(): void {
@@ -148,14 +149,14 @@ async function loadDefaultExport(
148
149
  // URL yet, and a repeat load (the one that could replay an evaluation
149
150
  // made under earlier env values) re-evaluates in a worker instead
150
151
  // (`loadedConfigs`, item 678).
151
- const literal = configPath.includes('\\')
152
+ const literal = /[\\?]/.test(configPath)
152
153
  const source =
153
154
  kind === 'Project' || literal
154
155
  ? servableSource(bytes, /\.[cm]?ts$/.test(configPath) ? 'ts' : 'js')
155
156
  : null
156
157
  if (literal && source === null) {
157
158
  throw new UserError(
158
- `${kind} config ${configPath} sits under a path that holds a backslash, which Bun loads only as an ES module in UTF-8`,
159
+ `${kind} config ${configPath} sits under a path that holds ${configPath.includes('\\') ? 'a backslash' : 'a question mark'}, which Bun loads only as an ES module in UTF-8`,
159
160
  )
160
161
  }
161
162
  const hash = xxh3hex(bytes)