@vzn/vx 0.0.640 → 0.0.642

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 (76) hide show
  1. package/launcher.sh +9 -2
  2. package/package.json +5 -12
  3. package/skills/vx/SKILL.md +4 -4
  4. package/src/bin.ts +8 -6
  5. package/src/cache/archive.ts +735 -107
  6. package/src/cache/cache.ts +133 -29
  7. package/src/cache/fold-memo.ts +58 -0
  8. package/src/cache/git-inputs.ts +213 -31
  9. package/src/cache/index.ts +9 -2
  10. package/src/cache/inputs.ts +244 -108
  11. package/src/cache/key-fold.ts +90 -69
  12. package/src/cache/layer.ts +9 -7
  13. package/src/cache/layered-cache.ts +74 -9
  14. package/src/cache/output-index.ts +25 -4
  15. package/src/cache/remote-lane.ts +27 -10
  16. package/src/cache/schema.ts +13 -3
  17. package/src/cache/scoped-cache.ts +11 -3
  18. package/src/cache/umask.ts +29 -0
  19. package/src/cli/docs.ts +71 -7
  20. package/src/cli/help.ts +11 -5
  21. package/src/cli/plan-format.ts +4 -1
  22. package/src/cli/run.ts +10 -3
  23. package/src/cli/select.ts +2 -0
  24. package/src/cli/upgrade.ts +37 -2
  25. package/src/cli/watch-filter.ts +1 -6
  26. package/src/cli/watch-fs.ts +2 -1
  27. package/src/exec/runner.ts +5 -0
  28. package/src/exec/sandbox-runtime.ts +81 -1
  29. package/src/graph/priorities.ts +14 -1
  30. package/src/handoff.ts +5 -0
  31. package/src/history/history.ts +43 -33
  32. package/src/index.ts +11 -1
  33. package/src/orchestrator/deferred-outputs.ts +3 -2
  34. package/src/orchestrator/execute-task.ts +20 -14
  35. package/src/orchestrator/hit-restore.ts +111 -29
  36. package/src/orchestrator/index.ts +1 -0
  37. package/src/orchestrator/local-shortcircuit.ts +8 -0
  38. package/src/orchestrator/lockfile-claim.ts +54 -8
  39. package/src/orchestrator/miss-save.ts +27 -17
  40. package/src/orchestrator/output-host.ts +9 -1
  41. package/src/orchestrator/plan.ts +4 -0
  42. package/src/orchestrator/plugin-host.ts +35 -5
  43. package/src/orchestrator/plugin.ts +29 -3
  44. package/src/orchestrator/prepare.ts +74 -5
  45. package/src/orchestrator/projects.ts +6 -1
  46. package/src/orchestrator/run-report.ts +30 -9
  47. package/src/orchestrator/run.ts +62 -38
  48. package/src/orchestrator/sandbox-request.ts +1 -48
  49. package/src/orchestrator/save-lane.ts +17 -10
  50. package/src/orchestrator/signals.ts +7 -10
  51. package/src/orchestrator/stable-keys.ts +83 -25
  52. package/src/orchestrator/task-hash.ts +46 -12
  53. package/src/report/events.ts +12 -0
  54. package/src/report/framed-output.ts +2 -1
  55. package/src/report/logger.ts +58 -15
  56. package/src/report/status-line.ts +45 -4
  57. package/src/report/summary.ts +11 -6
  58. package/src/util/errors.ts +1 -1
  59. package/src/util/hidden-prompt.ts +74 -0
  60. package/src/util/index.ts +13 -0
  61. package/src/util/paths.ts +58 -5
  62. package/src/util/secrets.ts +150 -0
  63. package/src/workspace/affected.ts +63 -13
  64. package/src/workspace/config-eval.ts +2 -2
  65. package/src/workspace/config-schema.ts +37 -3
  66. package/src/workspace/project-loader.ts +6 -4
  67. package/src/workspace/workspace.ts +17 -11
  68. package/docs/caching.md +0 -2352
  69. package/docs/cli.md +0 -3280
  70. package/docs/execution.md +0 -675
  71. package/docs/features.md +0 -178
  72. package/docs/patterns.md +0 -219
  73. package/docs/schema.md +0 -2461
  74. package/docs/security.md +0 -252
  75. package/src/cli/docs-corpus.ts +0 -21
  76. package/src/cli/docs-text.d.ts +0 -5
@@ -188,14 +188,19 @@ export function linkDiscoveredEdges(
188
188
  [edge.reach, reach],
189
189
  ] as const) {
190
190
  for (const target of kind) {
191
- const dir = path.resolve(root, target)
192
- const rel = relPosix(root, dir)
193
- const where = `plugin '${edge.by}' gave project "${edge.meta.name}" an edge to ${target}`
194
- if (rel === '..' || rel.startsWith('../') || path.isAbsolute(rel)) {
195
- throw new UserError(`${where}: outside the workspace root`)
191
+ // Every project lies inside the root (`discoveredProject` refuses
192
+ // one that does not), so a target naming one needs no other check:
193
+ // a plugin hands project dirs as they are, absolute, and resolving
194
+ // and judging each of 5,000 edges was ~15 ms at 1,000 projects.
195
+ const name = byDir.get(target) ?? byDir.get(path.resolve(root, target))
196
+ if (name === undefined) {
197
+ const rel = relPosix(root, path.resolve(root, target))
198
+ const where = `plugin '${edge.by}' gave project "${edge.meta.name}" an edge to ${target}`
199
+ if (rel === '..' || rel.startsWith('../') || path.isAbsolute(rel)) {
200
+ throw new UserError(`${where}: outside the workspace root`)
201
+ }
202
+ throw new UserError(`${where}: not a project`)
196
203
  }
197
- const name = byDir.get(dir)
198
- if (name === undefined) throw new UserError(`${where}: not a project`)
199
204
  let set = into.get(edge.meta)
200
205
  if (set === undefined) into.set(edge.meta, (set = new Set()))
201
206
  set.add(name)
@@ -417,12 +422,13 @@ export function lockedProjects(
417
422
  * The project a plugin's `discover` entry names: a new meta (`added`) for a
418
423
  * directory that is not a project yet, else the project already there,
419
424
  * renamed when its name was its path's. A config's `name` wins over the
420
- * plugin's; a name another plugin gave is not changed. `by` names the
421
- * plugin in a refusal.
425
+ * plugin's; a name another plugin gave is not changed. `known` is the
426
+ * projects by directory: a scan per entry was quadratic, 106 ms of a 5,000
427
+ * project warm run. `by` names the plugin in a refusal.
422
428
  */
423
429
  export async function discoveredProject(
424
430
  root: string,
425
- known: readonly ProjectMeta[],
431
+ known: ReadonlyMap<string, ProjectMeta>,
426
432
  entry: {
427
433
  readonly dir: string
428
434
  readonly name?: string
@@ -456,7 +462,7 @@ export async function discoveredProject(
456
462
  throw new UserError(`${where}${named} at ${dir}: outside the workspace root`)
457
463
  }
458
464
  const shown = rel === '' ? '.' : rel
459
- const meta = known.find((p) => p.dir === dir)
465
+ const meta = known.get(dir)
460
466
  if (meta !== undefined) {
461
467
  const from = namedBy.get(meta)
462
468
  if (name === undefined || name === meta.name || from === 'config') return { meta, added: false }