@vzn/vx 0.0.650 → 0.0.651

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 (115) hide show
  1. package/README.md +5 -20
  2. package/package.json +5 -5
  3. package/schemas/last.json +15 -0
  4. package/src/bin.ts +9 -31
  5. package/src/cache/cache.ts +202 -25
  6. package/src/cache/file-hashes.ts +3 -0
  7. package/src/cache/git-inputs.ts +188 -39
  8. package/src/cache/index.ts +1 -0
  9. package/src/cache/inputs.ts +3 -0
  10. package/src/cache/layer.ts +11 -0
  11. package/src/cache/layered-cache.ts +4 -0
  12. package/src/cache/linked-inputs.ts +3 -0
  13. package/src/cache/lockfile-memo.ts +3 -2
  14. package/src/cache/output-index.ts +5 -2
  15. package/src/cache/remote-lane.ts +2 -1
  16. package/src/cache/run-history.ts +11 -1
  17. package/src/cache/schema.ts +11 -1
  18. package/src/cli/cache.ts +26 -16
  19. package/src/cli/completions.ts +4 -2
  20. package/src/cli/docs.ts +10 -11
  21. package/src/cli/help.ts +12 -23
  22. package/src/cli/index.ts +4 -9
  23. package/src/cli/info.ts +15 -7
  24. package/src/cli/init.ts +23 -15
  25. package/src/cli/last.ts +213 -203
  26. package/src/cli/lock.ts +55 -5
  27. package/src/cli/plan-format.ts +100 -118
  28. package/src/cli/plugin-commands.ts +8 -2
  29. package/src/cli/plugin-templates.ts +2 -2
  30. package/src/cli/run.ts +46 -27
  31. package/src/cli/select.ts +43 -5
  32. package/src/cli/show.ts +38 -42
  33. package/src/cli/task-verb.ts +22 -0
  34. package/src/cli/upgrade.ts +3 -1
  35. package/src/cli/watch-fs.ts +6 -1
  36. package/src/cli/watch-judge.ts +2 -1
  37. package/src/cli/watch.ts +83 -44
  38. package/src/cli/why.ts +123 -89
  39. package/src/cli/workspace-config.ts +2 -1
  40. package/src/exec/executor.ts +2 -1
  41. package/src/exec/kill-tree.ts +58 -5
  42. package/src/exec/local-executor.ts +1 -1
  43. package/src/exec/pipes.ts +152 -0
  44. package/src/exec/runner.ts +199 -182
  45. package/src/exec/sandbox-binds.ts +1 -1
  46. package/src/exec/sandbox-runtime.ts +11 -2
  47. package/src/exec/spawn-off.ts +154 -0
  48. package/src/exec/warm-shell.ts +146 -0
  49. package/src/graph/critical-path.ts +40 -28
  50. package/src/graph/priorities.ts +98 -44
  51. package/src/graph/scheduler.ts +14 -10
  52. package/src/graph/task-graph.ts +27 -1
  53. package/src/handoff.ts +10 -7
  54. package/src/history/history.ts +5 -0
  55. package/src/history/metrics.ts +9 -1
  56. package/src/index.ts +3 -1
  57. package/src/orchestrator/doctor.ts +1 -1
  58. package/src/orchestrator/execute-task.ts +16 -2
  59. package/src/orchestrator/graph-memo.ts +50 -1
  60. package/src/orchestrator/graph-stage.ts +6 -0
  61. package/src/orchestrator/index.ts +3 -0
  62. package/src/orchestrator/live-usage.ts +16 -11
  63. package/src/orchestrator/locked-digests.ts +63 -0
  64. package/src/orchestrator/lockfile-claim.ts +108 -29
  65. package/src/orchestrator/miss-save.ts +31 -3
  66. package/src/orchestrator/persistent-task.ts +3 -1
  67. package/src/orchestrator/plan.ts +5 -1
  68. package/src/orchestrator/plugin-host.ts +61 -0
  69. package/src/orchestrator/plugin.ts +47 -2
  70. package/src/orchestrator/prepare.ts +16 -1
  71. package/src/orchestrator/projects.ts +4 -1
  72. package/src/orchestrator/run-context.ts +29 -10
  73. package/src/orchestrator/run-failures.ts +1 -1
  74. package/src/orchestrator/run-records.ts +10 -0
  75. package/src/orchestrator/run.ts +53 -22
  76. package/src/orchestrator/sandbox-request.ts +2 -2
  77. package/src/orchestrator/signals.ts +8 -5
  78. package/src/orchestrator/task-hash.ts +17 -3
  79. package/src/report/events.ts +3 -11
  80. package/src/report/forecast.ts +10 -32
  81. package/src/report/framed-output.ts +272 -173
  82. package/src/report/index.ts +8 -3
  83. package/src/report/logger.ts +73 -38
  84. package/src/report/plain-output.ts +1 -1
  85. package/src/report/status-line.ts +49 -357
  86. package/src/report/summary.ts +100 -131
  87. package/src/ui/ansi.ts +48 -0
  88. package/src/ui/components.ts +506 -0
  89. package/src/ui/index.ts +79 -0
  90. package/src/ui/kit.ts +37 -0
  91. package/src/ui/live-region.ts +363 -0
  92. package/src/{util/refusal-notice.ts → ui/refusal.ts} +7 -5
  93. package/src/ui/terminal.ts +51 -0
  94. package/src/ui/theme.ts +224 -0
  95. package/src/ui/version-line.ts +28 -0
  96. package/src/util/config-frame.ts +65 -10
  97. package/src/util/edit-distance.ts +6 -1
  98. package/src/util/index.ts +2 -15
  99. package/src/util/paths.ts +20 -2
  100. package/src/util/secret-mask.ts +39 -3
  101. package/src/util/settle.ts +31 -0
  102. package/src/util/timing.ts +4 -16
  103. package/src/workspace/affected.ts +89 -30
  104. package/src/workspace/config-schema.ts +4 -2
  105. package/src/workspace/dependencies-lock.ts +191 -0
  106. package/src/workspace/filter.ts +28 -0
  107. package/src/workspace/index.ts +9 -0
  108. package/src/workspace/lockfile.ts +159 -6
  109. package/src/workspace/migration.ts +4 -3
  110. package/src/workspace/workspace.ts +3 -0
  111. package/src/util/colors.ts +0 -133
  112. package/src/util/report.ts +0 -44
  113. package/src/util/ui.ts +0 -258
  114. /package/src/{report/path-links.ts → ui/links.ts} +0 -0
  115. /package/src/{report → ui}/terminal-signals.ts +0 -0
@@ -12,8 +12,6 @@ export interface LiveForecast {
12
12
  critical?: string
13
13
  /** Tasks not started because a dependency has not finished: the tasks line's `blocked`. */
14
14
  waiting: number
15
- /** Each running task's p50, where history knows it: the row's expected duration. */
16
- expected?: ReadonlyMap<string, number>
17
15
  /**
18
16
  * Tasks not started because a dependency has not finished, in the order
19
17
  * the scheduler would start them, at most one per worker: what an idle
@@ -21,13 +19,12 @@ export interface LiveForecast {
21
19
  */
22
20
  blocked?: readonly BlockedTask[]
23
21
  /**
24
- * Each running task's count of the tasks downstream of it (a group,
25
- * which runs nothing, looked through): its row's `blocks` cell, why they
26
- * are not running. A task downstream of two running tasks counts under both.
22
+ * Each running task's count of what is downstream of it, the
23
+ * scheduler's own count (`computeReverseDepCount`): its row's `blocks`
24
+ * cell, why they are not running. A node downstream of two running tasks
25
+ * counts under both.
27
26
  */
28
27
  blockedBy: ReadonlyMap<string, number>
29
- /** Each task's usual time (its executed p50), for the results' `±usual`. */
30
- usual?: ReadonlyMap<string, number>
31
28
  }
32
29
 
33
30
  /** A task an unfinished dependency holds back, and what holds it: the running task its longest chain waits on, else that dependency. */
@@ -54,8 +51,8 @@ export function createForecast(
54
51
  nodes: ReadonlyMap<string, TaskNode>,
55
52
  p50s: ReadonlyMap<string, number>,
56
53
  concurrency: number,
57
- /** Each task's count of the tasks downstream of it (`blocksCounts`); computed here when absent. */
58
- downstream: ReadonlyMap<string, number> = blocksCounts(nodes),
54
+ /** Every node's dependents count, the scheduler's baseline and the rows' `blocks`; computed here when absent. */
55
+ rank: ReadonlyMap<string, number> = computeReverseDepCount(nodes),
59
56
  ): Forecast {
60
57
  // Dependencies before dependents, once: each call is one pass over it.
61
58
  const order: TaskNode[] = []
@@ -87,9 +84,8 @@ export function createForecast(
87
84
  if (p !== undefined) cost.set(n.id, p)
88
85
  }
89
86
  const workers = Math.max(1, concurrency)
90
- // The scheduler's own baseline ranking, most dependents first, ties in
91
- // graph order: once per run, as the scheduler computes it.
92
- const rank = computeReverseDepCount(nodes)
87
+ // The scheduler's own baseline ranking (`rank`), most dependents first,
88
+ // ties in graph order.
93
89
  const position = new Map(order.map((n, i) => [n.id, i]))
94
90
  const before = (a: string, b: string): boolean => {
95
91
  const d = (rank.get(a) ?? 0) - (rank.get(b) ?? 0)
@@ -97,12 +93,7 @@ export function createForecast(
97
93
  }
98
94
 
99
95
  return (finished, running, nowMs) => {
100
- const expected = new Map<string, number>()
101
96
  let waiting = 0
102
- for (const id of running.keys()) {
103
- const p = cost.get(id)
104
- if (p !== undefined) expected.set(id, p)
105
- }
106
97
  const end = new Map<string, number>()
107
98
  // The running task each node's longest chain waits on.
108
99
  const head = new Map<string, string>()
@@ -153,30 +144,17 @@ export function createForecast(
153
144
  work += own
154
145
  }
155
146
  for (const id of running.keys()) {
156
- const d = downstream.get(id)
147
+ const d = rank.get(id)
157
148
  if (d !== undefined && d > 0) blockedBy.set(id, d)
158
149
  }
159
- if (!known) return { waiting, expected, blocked: held, blockedBy, usual: cost }
150
+ if (!known) return { waiting, blocked: held, blockedBy }
160
151
  const critical = chainEnd === undefined ? undefined : head.get(chainEnd)
161
152
  return {
162
153
  etaMs: Math.max(chain, work / workers),
163
154
  ...(critical !== undefined ? { critical } : {}),
164
155
  waiting,
165
- expected,
166
156
  blocked: held,
167
157
  blockedBy,
168
- usual: cost,
169
158
  }
170
159
  }
171
160
  }
172
-
173
- /**
174
- * Each task's `blocks`: how many tasks, a group's own looked through and
175
- * none counted, sit downstream of it in the run, each once (2026-10-29:
176
- * every task it holds back, not only the next ones).
177
- */
178
- export function blocksCounts(nodes: ReadonlyMap<string, TaskNode>): Map<string, number> {
179
- const tasks = new Map<string, true>()
180
- for (const n of nodes.values()) if (!isGroupTask(n)) tasks.set(n.id, true)
181
- return computeReverseDepCount(nodes, tasks)
182
- }