bullswarm 0.34.0 → 0.35.0
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/CHANGELOG.md +27 -0
- package/docs/design/dashboard-prototype.html +9 -2
- package/docs/design/dashboard-split/README.md +402 -0
- package/docs/design/step-page-0.35.0/README.md +394 -0
- package/docs/design/step-page-0.35.0/frames/failed-120.txt +19 -0
- package/docs/design/step-page-0.35.0/frames/failed-200.txt +19 -0
- package/docs/design/step-page-0.35.0/frames/failed-55.txt +18 -0
- package/docs/design/step-page-0.35.0/frames/finished-120.txt +19 -0
- package/docs/design/step-page-0.35.0/frames/finished-200.txt +17 -0
- package/docs/design/step-page-0.35.0/frames/finished-55.txt +20 -0
- package/docs/design/step-page-0.35.0/frames/real-failed-120.txt +60 -0
- package/docs/design/step-page-0.35.0/frames/real-failed-200.txt +60 -0
- package/docs/design/step-page-0.35.0/frames/real-failed-55.txt +60 -0
- package/docs/design/step-page-0.35.0/frames/real-finished-120.txt +60 -0
- package/docs/design/step-page-0.35.0/frames/real-finished-200.txt +60 -0
- package/docs/design/step-page-0.35.0/frames/real-finished-55.txt +60 -0
- package/docs/design/step-page-0.35.0/frames/real-running-120.txt +60 -0
- package/docs/design/step-page-0.35.0/frames/real-running-200.txt +60 -0
- package/docs/design/step-page-0.35.0/frames/real-running-55.txt +60 -0
- package/docs/design/step-page-0.35.0/frames/rendered-failed-120.txt +30 -0
- package/docs/design/step-page-0.35.0/frames/rendered-failed-200.txt +28 -0
- package/docs/design/step-page-0.35.0/frames/rendered-failed-55.txt +30 -0
- package/docs/design/step-page-0.35.0/frames/rendered-finished-120.txt +30 -0
- package/docs/design/step-page-0.35.0/frames/rendered-finished-200.txt +28 -0
- package/docs/design/step-page-0.35.0/frames/rendered-finished-55.txt +30 -0
- package/docs/design/step-page-0.35.0/frames/rendered-running-120.txt +30 -0
- package/docs/design/step-page-0.35.0/frames/rendered-running-200.txt +28 -0
- package/docs/design/step-page-0.35.0/frames/rendered-running-55.txt +30 -0
- package/docs/design/step-page-0.35.0/frames/running-120.txt +24 -0
- package/docs/design/step-page-0.35.0/frames/running-200.txt +21 -0
- package/docs/design/step-page-0.35.0/frames/running-55.txt +21 -0
- package/docs/guide/observing.md +127 -0
- package/docs/plans/dashboard-split.goal.txt +5 -0
- package/docs/plans/dashboard-split.program.json +94 -0
- package/docs/plans/meter-ledger.goal.txt +6 -0
- package/docs/plans/meter-ledger.program.json +8 -10
- package/docs/plans/step-page-0.35.0-build.goal.txt +8 -0
- package/docs/plans/step-page-0.35.0-build.program.json +164 -0
- package/docs/plans/step-page-0.35.0-design.goal.txt +6 -0
- package/docs/plans/step-page-0.35.0-design.program.json +49 -0
- package/docs/plans/step-page-0.35.0.program.json +98 -0
- package/docs/reference/cli.md +39 -2
- package/docs/reference/providers.md +64 -1
- package/package.json +1 -1
- package/src/cli.js +57 -11
- package/src/help.js +56 -0
- package/src/home-cli.js +392 -0
- package/src/lib/agent-events.js +144 -0
- package/src/lib/assignments.js +3 -1
- package/src/lib/attempt-stream.js +11 -1
- package/src/lib/cli-flags.js +2 -0
- package/src/lib/config.js +46 -4
- package/src/lib/quota-snapshot.js +50 -1
- package/src/lib/strategy.js +2 -1
- package/src/lib/subscription-cost.js +376 -8
- package/src/lib/tasks.js +8 -2
- package/src/lib/transcripts/claude-code.js +7 -3
- package/src/lib/transcripts/codex.js +7 -3
- package/src/lib/transcripts/grok.js +11 -3
- package/src/lib/transcripts/index.js +1 -0
- package/src/lib/usage-basis.js +88 -16
- package/src/lib/watch.js +357 -9
- package/src/meters/framework.js +94 -0
- package/src/meters/registry.js +368 -15
- package/src/provider-cli.js +23 -0
- package/src/providers/_schema.json +62 -0
- package/src/providers/claude-code/connector.json +71 -3
- package/src/providers/codex/connector.json +85 -0
- package/src/providers/grok/connector.json +57 -0
- package/src/strategy-cli.js +3 -2
- package/src/strategy-dashboard.js +2 -1
- package/src/workflow/budget-model.js +13 -0
- package/src/workflow/budget-view.js +27 -4
- package/src/workflow/cli.js +10 -1
- package/src/workflow/dash-kit.js +2 -1
- package/src/workflow/dashboard.js +319 -2821
- package/src/workflow/history.js +7 -0
- package/src/workflow/home-model.js +229 -0
- package/src/workflow/home-view.js +709 -0
- package/src/workflow/reprice.js +192 -28
- package/src/workflow/rollup.js +13 -10
- package/src/workflow/run-model.js +480 -0
- package/src/workflow/run-view.js +1202 -0
- package/src/workflow/runs-cli.js +3 -4
- package/src/workflow/runs-view.js +197 -0
- package/src/workflow/stat-kit.js +65 -7
- package/src/workflow/stats-model.js +18 -5
- package/src/workflow/stats-view.js +1 -1
- package/src/workflow/step-model.js +1014 -0
- package/src/workflow/step-view.js +546 -0
- package/src/workflow/usage-view.js +16 -0
- package/src/workflow/v2-dispatch.js +8 -0
- package/src/workflow/v2-outcome.js +2 -1
- package/src/workflow/v2-runtime.js +240 -12
- package/src/workflow/v2-state.js +57 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# bullswarm changelog
|
|
2
2
|
|
|
3
|
+
## 0.35.0 — the Step page tells the whole story
|
|
4
|
+
|
|
5
|
+
- step: the Step page leads with identity and verdict, the selected attempt,
|
|
6
|
+
retry history, route, money pair, activity, outcome, prompt, and artifacts.
|
|
7
|
+
- verification: execution success stays separate from the workflow's durable
|
|
8
|
+
`verified` result, so a successful action is not mistaken for accepted work.
|
|
9
|
+
- activity: the page follows a bounded per-attempt stream with capture-order
|
|
10
|
+
minimap, selection, filters, and explicit unavailable states instead of
|
|
11
|
+
inferring turns, tools, timing, usage, or subagents from prose.
|
|
12
|
+
- usage: API-rate and subscription figures remain a labeled pair; token source,
|
|
13
|
+
unknown values, pending live usage, and estimated bases stay visible across
|
|
14
|
+
retries rather than becoming zero or a bare dollar amount.
|
|
15
|
+
- providers: the guide and provider reference now list the optional normalized
|
|
16
|
+
stream fields each shipped capture can actually supply.
|
|
17
|
+
- watch: a truncated delegate response now gets one connector-declared recovery turn or a derived workspace/test report, with the recovery source persisted on the attempt.
|
|
18
|
+
- meters: a quota refusal forces a fresh meter read and marks the pool blocked until it clears, with the refusal age shown in Pools, Budget, and Usage.
|
|
19
|
+
- stats: single `bullswarm run` records retain their working directory so Stats and history derive the project while truly legacy records remain unknown.
|
|
20
|
+
- dashboard: the navigation footer keeps active run names visible and adds `+N more` when the terminal is too narrow.
|
|
21
|
+
- stats: model labels preserve provider/model identity at narrow widths instead of collapsing to a bare version.
|
|
22
|
+
- reprice: transcript matches can back-fill missing cwd and project fields for workflow attempts and single tasks, reporting the project changes.
|
|
23
|
+
- money: sub-cent API, subscription, budget, and strategy amounts keep three significant digits instead of rounding to `$0.00`.
|
|
24
|
+
- meters: a continuous, window-specific ledger records resolution and source, names each interval, attributes positive quota deltas to each attempt, shares overlaps by API cost, and reconciles same-pool totals at run finish.
|
|
25
|
+
- home: `home snapshot` creates a selective dashboard-readable copy of routing, meters, providers, task records, and chosen workflow runs without modifying the source.
|
|
26
|
+
- dashboard: the Home, Runs, Run and Step pages now live in their own model and
|
|
27
|
+
view modules; dashboard.js shrinks from 5,996 to 3,494 lines with every saved
|
|
28
|
+
frame rendering identically.
|
|
29
|
+
|
|
3
30
|
## 0.34.0 — every dollar says how it was measured
|
|
4
31
|
|
|
5
32
|
- usage: Claude, Codex, and Grok attempts now retain provider-reported or transcript-summed token classes, with the byte estimate and unknown kept as explicit fallbacks.
|
|
@@ -219,7 +219,14 @@
|
|
|
219
219
|
const K = (act, text) => `{{k|${act}|${text}}}`;
|
|
220
220
|
const fmtM = (sec) => { const m = Math.floor(sec / 60); return m >= 60 ? `${Math.floor(m / 60)}h${String(m % 60).padStart(2, '0')}m` : `${m}m`; };
|
|
221
221
|
const fmtMS = (sec) => { const m = Math.floor(sec / 60), s = Math.floor(sec % 60); return m ? `${m}m${String(s).padStart(2, '0')}s` : `${s}s`; };
|
|
222
|
-
const money = (v) =>
|
|
222
|
+
const money = (v) => {
|
|
223
|
+
const number = Number(v);
|
|
224
|
+
if (!Number.isFinite(number)) return '-';
|
|
225
|
+
if (number >= 0.10) {
|
|
226
|
+
return `$${number.toLocaleString('en-US', { useGrouping: false, minimumFractionDigits: 2, maximumFractionDigits: 2 })}`;
|
|
227
|
+
}
|
|
228
|
+
return number === 0 ? '$0' : `$${Number(number.toPrecision(3))}`;
|
|
229
|
+
};
|
|
223
230
|
const bar = (frac, w) => { const f = Math.round(w * Math.max(0, Math.min(1, frac))); return `{{g|${'▇'.repeat(f)}}}{{d|${'░'.repeat(w - f)}}}`; };
|
|
224
231
|
|
|
225
232
|
// ---------- world ----------
|
|
@@ -381,7 +388,7 @@
|
|
|
381
388
|
const d = dayAt(back), wk = d.getDay() === 0 || d.getDay() === 6;
|
|
382
389
|
const runs = wk ? Math.round(rnd(back * 3) * 3) : 2 + Math.round(rnd(back * 3) * 5);
|
|
383
390
|
const ok = Math.max(0, runs - Math.round(rnd(back * 5) * Math.min(2, runs)));
|
|
384
|
-
const spent = runs ?
|
|
391
|
+
const spent = runs ? Math.round(runs * (1.2 + rnd(back * 7) * 1.4) * 100) / 100 : 0;
|
|
385
392
|
const mix = [0.35 + rnd(back * 11) * 0.3, 0.15 + rnd(back * 13) * 0.2, 0.1 + rnd(back * 17) * 0.15]; const rest = Math.max(0, 1 - mix[0] - mix[1] - mix[2]);
|
|
386
393
|
return { runs, ok, spent, byPool: { 'claude-code': spent * mix[0], codex: spent * mix[1], grok: spent * mix[2], 'command-code': spent * rest }, licence: { 'claude-code': runs ? 4 + rnd(back * 19) * 9 : 0, codex: runs ? 2 + rnd(back * 23) * 6 : 0 } };
|
|
387
394
|
}
|
|
@@ -0,0 +1,402 @@
|
|
|
1
|
+
Read-only study complete. The repository is unchanged and clean: `## dash-split`.
|
|
2
|
+
|
|
3
|
+
## 1. Function inventory
|
|
4
|
+
|
|
5
|
+
Classification is based on `rg` call sites and transitive callers, not function names. Nested closures move with their parent and are not separate exports.
|
|
6
|
+
|
|
7
|
+
### Home-only
|
|
8
|
+
|
|
9
|
+
- `taskToday`, `todayMinutesText`, `todayMinutesNumberText`, `measuredTaskMinutes`, `todayDateLabel`, `todayGoalLine`, `todayWorkflowLine`, `todayTaskLine`, `todayRows`, `poolRatePerMinute`, `todayLicenceRows`, `todayPoolName`, `todayTableRow`, `todayBareRule`, `todayPadded`, `todayLicenceFootnotes`, `homeTodayBand` — [dashboard.js:1371-1700](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/src/workflow/dashboard.js:1371)
|
|
10
|
+
- `compactUsageBasisText`, `percentText`, `shareText` — [dashboard.js:2174-2207](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/src/workflow/dashboard.js:2174)
|
|
11
|
+
- `paceOnly`, `budgetWeekLines`, `breakdownCells`, `summaryBand`, `homePage`, `homeDetails`, `recordCost`, `recordCostInfo` — [dashboard.js:2801-3242](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/src/workflow/dashboard.js:2801)
|
|
12
|
+
|
|
13
|
+
### Runs-only
|
|
14
|
+
|
|
15
|
+
- `keyHint`, `navigationFooter`, `breadcrumbSegments`, `breadcrumbLine`, `isWaitingWorkflow`, `workflowConcernCount`, `dashboardRunLines`, `listWindow`, `humanWorkflowStatus`, `humanPhaseName`, `filterDashboardRows`, `runsPage` — [dashboard.js:220-598](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/src/workflow/dashboard.js:220), [dashboard.js:3245-3285](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/src/workflow/dashboard.js:3245)
|
|
16
|
+
- `renderDashboard` is the legacy Runs-list adapter, but it also invokes the Run overview renderer, so it remains a shell compatibility adapter rather than a pure Runs module — [dashboard.js:432-497](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/src/workflow/dashboard.js:432)
|
|
17
|
+
|
|
18
|
+
### Run-only
|
|
19
|
+
|
|
20
|
+
- `runFrame`, `workflowTechnicalLines`, `humanStatus`, `plannerDisplayStatus`, `plannerUsageSummary`, `orchestratorDetailLines`, `compactAgentPreviewLines`, `panelWindow`, `dimLine`, `runningMark`, `actionNamedIn`, `markStepRows` — [dashboard.js:721-895](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/src/workflow/dashboard.js:721), [dashboard.js:1702-2045](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/src/workflow/dashboard.js:1702), [dashboard.js:2430-2457](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/src/workflow/dashboard.js:2430)
|
|
21
|
+
- `planAttemptDetail`, `planStageLabel`, `planStageHeader`, `planStageActions`, `planMoreParts`, `phaseActionGlyph`, `fittedParts`, `planPhaseActionParts`, `planDagLines`, `flatTimelineLines`, `stepTally`, `runBudgetRows`, `runLiveRows`, `runSoFarRows`, `runBlankReasons`, `runPage` — [dashboard.js:3344-3932](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/src/workflow/dashboard.js:3344)
|
|
22
|
+
|
|
23
|
+
### Step-only
|
|
24
|
+
|
|
25
|
+
- `stepPage` — [dashboard.js:3938-4049](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/src/workflow/dashboard.js:3938)
|
|
26
|
+
|
|
27
|
+
The Step design record confirms that Step should consume shared helpers and that `stepProgressText` has no caller: [step-page README:282-375](/Users/cowcow02/Repo/bullswork/bullswarm-0.35.0/docs/design/step-page-0.35.0/README.md:282).
|
|
28
|
+
|
|
29
|
+
### Shared by exactly two
|
|
30
|
+
|
|
31
|
+
- Home + Runs: `workflowRunLabel`, `taskIdText`, `taskPoolModelText`, `taskElapsedText`, `taskIdentity`, `strong`, `ageText`, `planStripParts`, `stepBarText`, `assignmentOf`, `stepPool` — [dashboard.js:504-511](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/src/workflow/dashboard.js:504), [dashboard.js:1357-1388](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/src/workflow/dashboard.js:1357), [dashboard.js:1749-1753](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/src/workflow/dashboard.js:1749), [dashboard.js:2215-2220](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/src/workflow/dashboard.js:2215), [dashboard.js:2541-2560](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/src/workflow/dashboard.js:2541), [dashboard.js:2752-2790](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/src/workflow/dashboard.js:2752)
|
|
32
|
+
- Home + Run: `okMark`, `failMark`, `pendingMark`, `pushColumns` — [dashboard.js:1756-1785](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/src/workflow/dashboard.js:1756)
|
|
33
|
+
- Runs + Run: `stateStatus`, `stateFinishedAt`, `tokenText`, `renderPanel`, `joinPanels`, `renderWorkflowOverviewPanel`, `sectionDivider`, `groupedTimeline`, `timelineSegmentDisplayName`, `workflowTimelineLines`, `segmentHeader`, `continuationHeader`, `currentTimelineSegment`, `timelineText`, `workflowLiveLines`, `workflowNextLines`, `streamActivityLine`, `friendlyActionKind`, `friendlyActionSummary`, `workflowStatusIcon`, `panelCell`, `selectLine`, `alignRight` — [dashboard.js:183-185](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/src/workflow/dashboard.js:183), [dashboard.js:282-294](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/src/workflow/dashboard.js:282), [dashboard.js:897-1336](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/src/workflow/dashboard.js:897), [dashboard.js:1817-1845](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/src/workflow/dashboard.js:1817), [dashboard.js:1990-2045](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/src/workflow/dashboard.js:1990)
|
|
34
|
+
- Run + Step: `compactUsage`, `actionRoleLabel`, `agentDetailLines`, `taskPreview`, `outcomePreview`, `about` — [dashboard.js:266-280](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/src/workflow/dashboard.js:266), [dashboard.js:1832-1959](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/src/workflow/dashboard.js:1832), [dashboard.js:2148-2150](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/src/workflow/dashboard.js:2148)
|
|
35
|
+
|
|
36
|
+
### Shared by three
|
|
37
|
+
|
|
38
|
+
The requested buckets omit this important middle category:
|
|
39
|
+
|
|
40
|
+
- Home + Runs + Run: `stateStartedAt`, `planLevels`, `planProgress`, `planStages`, `clockAt`
|
|
41
|
+
- Runs + Run + Step: `reasoningText`, `clockText`, `formatBytes`, `outputSparkline`, `statusIcon`, `durationText`, `wrapLines`
|
|
42
|
+
|
|
43
|
+
These live at [dashboard.js:184-185](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/src/workflow/dashboard.js:184), [dashboard.js:300-303](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/src/workflow/dashboard.js:300), [dashboard.js:1325-1355](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/src/workflow/dashboard.js:1325), [dashboard.js:1973-2017](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/src/workflow/dashboard.js:1973), [dashboard.js:2469-2538](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/src/workflow/dashboard.js:2469), and [dashboard.js:3379-3402](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/src/workflow/dashboard.js:3379).
|
|
44
|
+
|
|
45
|
+
### Shared by all four pages
|
|
46
|
+
|
|
47
|
+
`workflowPanelModel`, `dimText`, `rgbOf`, `tint`, `visibleLength`, `meterAnsi`, `blank`, `tokenSourceOf`, `worstTokenSource`, `usageBasisText`, `truncate`, `clamp`, `moneyText`, `minutesText`, `runEconomics` — [dashboard.js:656-713](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/src/workflow/dashboard.js:656), [dashboard.js:1718-1746](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/src/workflow/dashboard.js:1718), [dashboard.js:2019-2053](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/src/workflow/dashboard.js:2019), [dashboard.js:2138-2212](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/src/workflow/dashboard.js:2138), [dashboard.js:2570-2613](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/src/workflow/dashboard.js:2570).
|
|
48
|
+
|
|
49
|
+
### Shell/API and dead definitions
|
|
50
|
+
|
|
51
|
+
Keep these in the shell or existing adapters: `localDayKey`, `dayStart`, `pacedWindow`, `poolDayReadings`, `readLicencePerDay`, `writeClipboard`, `requestCancel`, `enrichRunRow`, `byNewestStart`, `dashboardRows`, `activeDashboardRows`, `renderDetails`, `renderV2Details`, `detailRow`, `overviewSnapshot`, `renderDashboardPage`, `tileSparklines`, `dashboardModel`, `renderWorkflowTui`, `runDashboard`, `dashboardJson`, plus the existing Task/Budget/Stats/History/Fleet/Help adapters and dashboard constants — [dashboard.js:58-497](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/src/workflow/dashboard.js:58), [dashboard.js:4052-4492](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/src/workflow/dashboard.js:4052), [dashboard.js:4512-5899](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/src/workflow/dashboard.js:4512).
|
|
52
|
+
|
|
53
|
+
Do not move definition-only dead blocks: `stepProgressText`, `tileText`, `homeLicencePools`, `todayPoolMinute`, `todayLivePoolMinute`, `licencePoolName`, `homeLicenceDisplay`, and `planAttemptMeta` — [dashboard.js:2616-2745](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/src/workflow/dashboard.js:2616), [dashboard.js:3325-3342](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/src/workflow/dashboard.js:3325).
|
|
54
|
+
|
|
55
|
+
## 2. Dependency graph and state ownership
|
|
56
|
+
|
|
57
|
+
```text
|
|
58
|
+
dashboardRows
|
|
59
|
+
-> enrichRunRow -> stateStatus/stateStartedAt/stateFinishedAt
|
|
60
|
+
|
|
61
|
+
dashboardModel
|
|
62
|
+
-> budgetModel + statsModel + tileSparklines
|
|
63
|
+
|
|
64
|
+
renderDashboardPage
|
|
65
|
+
-> homePage
|
|
66
|
+
-> runsPage
|
|
67
|
+
-> existing budget/stats/history/fleet/help pages
|
|
68
|
+
-> stepPage
|
|
69
|
+
-> taskPage
|
|
70
|
+
-> runPage
|
|
71
|
+
|
|
72
|
+
homePage -> homeTodayBand + activeRunLines + homeDetails
|
|
73
|
+
runsPage -> activeRunLines + daysWithTasks + history rendering
|
|
74
|
+
runPage -> runFrame
|
|
75
|
+
runFrame -> overview/timeline/plan/live/technical renderers
|
|
76
|
+
stepPage -> workflowPanelModel + shared Run/Step helpers
|
|
77
|
+
|
|
78
|
+
renderWorkflowTui
|
|
79
|
+
-> dashboardModel
|
|
80
|
+
-> renderDashboardPage
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
The dispatch is explicit at [dashboard.js:4404-4492](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/src/workflow/dashboard.js:4404). `dashboardModel` is the composition boundary at [dashboard.js:4512-4575](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/src/workflow/dashboard.js:4512), and the static TUI path is [dashboard.js:4582-4584](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/src/workflow/dashboard.js:4582).
|
|
84
|
+
|
|
85
|
+
`runDashboard` owns all mutable shell state: active/catalog/all rows, filtering, selection, painted frame, hover and chart-slice registries, usage/integration/install state, rollups, prices, meter history, task ledger, and the `ui` page/focus/scroll/follow/cancel/orchestrator state — [dashboard.js:4611-4818](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/src/workflow/dashboard.js:4611).
|
|
86
|
+
|
|
87
|
+
The important mutation paths are:
|
|
88
|
+
|
|
89
|
+
- `paintUnsafe` builds models, calls `renderDashboardPage`, replaces hit regions, and writes the differential frame — [dashboard.js:4915-4950](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/src/workflow/dashboard.js:4915).
|
|
90
|
+
- `refresh` handles TTL/signature checks and selection preservation — [dashboard.js:4970-5015](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/src/workflow/dashboard.js:4970).
|
|
91
|
+
- `openRun`, `openStep`, `openTask`, `openPage`, and `moveOut` mutate page/focus/selection — [dashboard.js:5020-5235](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/src/workflow/dashboard.js:5020).
|
|
92
|
+
- `runAction`, mouse-region handling, scrolling, timers, listeners, and terminal cleanup remain shell responsibilities — [dashboard.js:5236-5863](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/src/workflow/dashboard.js:5236).
|
|
93
|
+
|
|
94
|
+
## 3. Proposed module layout
|
|
95
|
+
|
|
96
|
+
### `src/workflow/home-model.js`
|
|
97
|
+
|
|
98
|
+
Exact exports:
|
|
99
|
+
|
|
100
|
+
```text
|
|
101
|
+
taskToday
|
|
102
|
+
taskIdentity
|
|
103
|
+
todayMinutesText
|
|
104
|
+
todayMinutesNumberText
|
|
105
|
+
measuredTaskMinutes
|
|
106
|
+
todayDateLabel
|
|
107
|
+
todayRows
|
|
108
|
+
poolRatePerMinute
|
|
109
|
+
todayLicenceRows
|
|
110
|
+
recordCost
|
|
111
|
+
recordCostInfo
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### `src/workflow/home-view.js`
|
|
115
|
+
|
|
116
|
+
Exact exports:
|
|
117
|
+
|
|
118
|
+
```text
|
|
119
|
+
homePage
|
|
120
|
+
homeTodayBand
|
|
121
|
+
homeDetails
|
|
122
|
+
todayGoalLine
|
|
123
|
+
todayWorkflowLine
|
|
124
|
+
todayTaskLine
|
|
125
|
+
todayPoolName
|
|
126
|
+
todayTableRow
|
|
127
|
+
todayBareRule
|
|
128
|
+
todayPadded
|
|
129
|
+
todayLicenceFootnotes
|
|
130
|
+
paceOnly
|
|
131
|
+
budgetWeekLines
|
|
132
|
+
breakdownCells
|
|
133
|
+
summaryBand
|
|
134
|
+
activeRunLines
|
|
135
|
+
taskIdText
|
|
136
|
+
taskPoolModelText
|
|
137
|
+
taskElapsedText
|
|
138
|
+
stepBarText
|
|
139
|
+
assignmentOf
|
|
140
|
+
stepPool
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
`activeRunLines` is intentionally exported because `runsPage` consumes it.
|
|
144
|
+
|
|
145
|
+
### `src/workflow/runs-view.js`
|
|
146
|
+
|
|
147
|
+
Exact exports:
|
|
148
|
+
|
|
149
|
+
```text
|
|
150
|
+
isWaitingWorkflow
|
|
151
|
+
workflowConcernCount
|
|
152
|
+
dashboardRunLines
|
|
153
|
+
listWindow
|
|
154
|
+
humanWorkflowStatus
|
|
155
|
+
humanPhaseName
|
|
156
|
+
filterDashboardRows
|
|
157
|
+
daysWithTasks
|
|
158
|
+
runsPage
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
The legacy `renderDashboard` remains in `dash-shell.js` as a compatibility adapter.
|
|
162
|
+
|
|
163
|
+
### `src/workflow/run-model.js`
|
|
164
|
+
|
|
165
|
+
Exact exports:
|
|
166
|
+
|
|
167
|
+
```text
|
|
168
|
+
workflowPanelModel
|
|
169
|
+
planLevels
|
|
170
|
+
planProgress
|
|
171
|
+
planStripParts
|
|
172
|
+
runEconomics
|
|
173
|
+
planAttemptDetail
|
|
174
|
+
planStages
|
|
175
|
+
planStageLabel
|
|
176
|
+
planStageHeader
|
|
177
|
+
planStageActions
|
|
178
|
+
planMoreParts
|
|
179
|
+
phaseActionGlyph
|
|
180
|
+
fittedParts
|
|
181
|
+
planPhaseActionParts
|
|
182
|
+
stepTally
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### `src/workflow/run-view.js`
|
|
186
|
+
|
|
187
|
+
Exact exports:
|
|
188
|
+
|
|
189
|
+
```text
|
|
190
|
+
runFrame
|
|
191
|
+
renderWorkflowOverviewPanel
|
|
192
|
+
sectionDivider
|
|
193
|
+
groupedTimeline
|
|
194
|
+
timelineSegmentDisplayName
|
|
195
|
+
workflowTimelineLines
|
|
196
|
+
segmentHeader
|
|
197
|
+
continuationHeader
|
|
198
|
+
currentTimelineSegment
|
|
199
|
+
timelineText
|
|
200
|
+
workflowLiveLines
|
|
201
|
+
workflowNextLines
|
|
202
|
+
workflowTechnicalLines
|
|
203
|
+
timelineRow
|
|
204
|
+
timelineDetail
|
|
205
|
+
alignRight
|
|
206
|
+
orchestratorDetailLines
|
|
207
|
+
humanStatus
|
|
208
|
+
plannerDisplayStatus
|
|
209
|
+
plannerUsageSummary
|
|
210
|
+
friendlyActionKind
|
|
211
|
+
friendlyActionSummary
|
|
212
|
+
compactAgentPreviewLines
|
|
213
|
+
planDagLines
|
|
214
|
+
flatTimelineLines
|
|
215
|
+
runBudgetRows
|
|
216
|
+
runLiveRows
|
|
217
|
+
runSoFarRows
|
|
218
|
+
runBlankReasons
|
|
219
|
+
runPage
|
|
220
|
+
actionNamedIn
|
|
221
|
+
markStepRows
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
`streamActivityLine` remains private to `workflowLiveLines`; shared Run/Step helpers remain shell-owned to preserve the Step contract.
|
|
225
|
+
|
|
226
|
+
### `src/workflow/dash-shell.js`
|
|
227
|
+
|
|
228
|
+
Retain the current public API and re-export `workflowPanelModel` for compatibility:
|
|
229
|
+
|
|
230
|
+
```text
|
|
231
|
+
DASHBOARD_KEYS
|
|
232
|
+
readLicencePerDay
|
|
233
|
+
writeClipboard
|
|
234
|
+
requestCancel
|
|
235
|
+
dashboardRows
|
|
236
|
+
activeDashboardRows
|
|
237
|
+
renderDashboard
|
|
238
|
+
renderDetails
|
|
239
|
+
workflowPanelModel
|
|
240
|
+
overviewSnapshot
|
|
241
|
+
renderDashboardPage
|
|
242
|
+
dashboardModel
|
|
243
|
+
renderWorkflowTui
|
|
244
|
+
runDashboard
|
|
245
|
+
dashboardJson
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
The shell also owns shared ANSI/layout primitives, data/index access, caches, timers, hit-region registration, event handlers, legacy render adapters, and existing Budget/Stats/History/Fleet/Help pages. Avoid duplicating helpers across page modules.
|
|
249
|
+
|
|
250
|
+
## 4. Extraction order
|
|
251
|
+
|
|
252
|
+
1. Finish and checkpoint the separate Step extraction first. Freeze its shared-helper contract according to the Step design record.
|
|
253
|
+
2. Extract Home model/view. Add focused Home tests, run them, then run `npm test`.
|
|
254
|
+
3. Extract Runs view. Preserve the Home/Runs `activeRunLines` identity assertion. Run focused tests and `npm test`.
|
|
255
|
+
4. Extract Run model/view. This is the largest and riskiest move; keep compatibility exports and preserve hit-region behavior. Run focused tests and `npm test`.
|
|
256
|
+
5. Integrate only after all three mechanical moves are present. Reconcile imports/exports, run the full suite, and perform the byte-identity proof below.
|
|
257
|
+
6. Do not combine the dead-code cleanup with extraction.
|
|
258
|
+
|
|
259
|
+
## 5. Test map
|
|
260
|
+
|
|
261
|
+
These tests import `dashboard.js`:
|
|
262
|
+
|
|
263
|
+
- `tests/workflow-dead-kernel.test.js:11`, assertions at `120-122`: import-only shell API.
|
|
264
|
+
- `tests/workflow-v2-caller-planner.test.js:21`, `requestCancel` at `704`: import-only.
|
|
265
|
+
- `tests/workflow-program.test.js:11`, `requestCancel` at `230`: import-only.
|
|
266
|
+
- `tests/glyphs.test.js:9`, renderer assertions at `160-169`: import-only shell API.
|
|
267
|
+
- `tests/workflow-v2-recovery.test.js:9`, `requestCancel` at `98`: import-only.
|
|
268
|
+
- `tests/workflow-legacy-runs.test.js:19`, behavior at `287-316`: import-only shell/API and legacy renderer.
|
|
269
|
+
- `tests/workflow-dashboard.test.js:7`: broad behavior suite. The only directly extracted non-shell symbol is `workflowPanelModel` at `216`, `1672`, `2064`, `2134`, and `3762-3764`; either update that import to `run-model.js` or preserve the compatibility re-export. Existing expected frames should not be rewritten — [workflow-dashboard.test.js:155-280](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/tests/workflow-dashboard.test.js:155), [workflow-dashboard.test.js:1108-1191](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/tests/workflow-dashboard.test.js:1108), [workflow-dashboard.test.js:2898-2999](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/tests/workflow-dashboard.test.js:2898), [workflow-dashboard.test.js:3346-3408](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/tests/workflow-dashboard.test.js:3346), [workflow-dashboard.test.js:3503-3579](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/tests/workflow-dashboard.test.js:3503).
|
|
270
|
+
|
|
271
|
+
Add focused tests:
|
|
272
|
+
|
|
273
|
+
```text
|
|
274
|
+
tests/workflow-home-model.test.js
|
|
275
|
+
tests/workflow-home-view.test.js
|
|
276
|
+
tests/workflow-runs-view.test.js
|
|
277
|
+
tests/workflow-run-model.test.js
|
|
278
|
+
tests/workflow-run-view.test.js
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
## 6. Byte-identical proof
|
|
282
|
+
|
|
283
|
+
Use a test-created temporary fixture, never live `~/.bullswarm`. The existing fixture and fidelity sizes are at [workflow-dashboard.test.js:956-990](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/tests/workflow-dashboard.test.js:956) and [workflow-dashboard.test.js:3177-3191](/Users/cowcow02/Repo/bullswork/bullswarm-dash-split/tests/workflow-dashboard.test.js:3177).
|
|
284
|
+
|
|
285
|
+
For each extraction:
|
|
286
|
+
|
|
287
|
+
1. Capture pre-change and post-change raw ANSI output for `home`, `runs`, `run`, and `step`.
|
|
288
|
+
2. Render at widths `55`, `120`, and `200`, with fixed height, `nowMs`, `spinnerFrame: 0`, selection, phase, and agent indices.
|
|
289
|
+
3. Use `renderDashboardPage(dashboardModel(...), options).lines.join('\n')`; also verify `renderWorkflowTui` because it delegates to the same entry.
|
|
290
|
+
4. Preserve ANSI bytes in the comparison.
|
|
291
|
+
|
|
292
|
+
Comparison:
|
|
293
|
+
|
|
294
|
+
```sh
|
|
295
|
+
for page in home runs run step; do
|
|
296
|
+
for width in 55 120 200; do
|
|
297
|
+
cmp --silent \
|
|
298
|
+
"before/${page}-${width}.txt" \
|
|
299
|
+
"after/${page}-${width}.txt" || \
|
|
300
|
+
diff -u --label before --label after \
|
|
301
|
+
"before/${page}-${width}.txt" \
|
|
302
|
+
"after/${page}-${width}.txt"
|
|
303
|
+
done
|
|
304
|
+
done
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
Also verify stripped-ANSI line widths, hit-region coordinates, page dispatch, mouse/key actions, and run `npm test`. A successful extraction requires `cmp` success for every captured page/width plus the full suite.
|
|
308
|
+
|
|
309
|
+
## 7. Risk and sizing
|
|
310
|
+
|
|
311
|
+
Using the exact proposed lists, current declaration-span estimates are approximately:
|
|
312
|
+
|
|
313
|
+
- Home: `153 + 579 = 732` lines.
|
|
314
|
+
- Runs: `147` lines.
|
|
315
|
+
- Run: `365 + 1,043 = 1,408` lines.
|
|
316
|
+
|
|
317
|
+
The call-site audit found approximately 22 Home boundary references, 13 Runs references, and 38 Run references, in addition to dispatcher/import/re-export edits. Run is riskiest because it combines the largest move with `runFrame`, timeline rendering, shared legacy overview rendering, Step helpers, shell-owned hit regions, caches, timers, and interactive handlers. Every step should therefore be mechanical, checkpointed, focused-tested, and followed by `npm test`.
|
|
318
|
+
|
|
319
|
+
## 8. Draft `bullswarm.workflow.program.v2`
|
|
320
|
+
|
|
321
|
+
Goal text:
|
|
322
|
+
|
|
323
|
+
```text
|
|
324
|
+
1. Extract Home, Runs, and Run from dashboard.js into the specified modules without changing behavior.
|
|
325
|
+
2. Prove the extraction is byte-identical at 55, 120, and 200 columns and leaves npm test green.
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
Program:
|
|
329
|
+
|
|
330
|
+
```json
|
|
331
|
+
{
|
|
332
|
+
"schemaVersion": "bullswarm.workflow.program.v2",
|
|
333
|
+
"actions": [
|
|
334
|
+
{
|
|
335
|
+
"id": "home-extraction",
|
|
336
|
+
"kind": "mechanical",
|
|
337
|
+
"purpose": "Extract Home model and view into dedicated modules",
|
|
338
|
+
"dependsOn": [],
|
|
339
|
+
"affects": ["requirement-1"],
|
|
340
|
+
"ownedFiles": [
|
|
341
|
+
"src/workflow/home-model.js",
|
|
342
|
+
"src/workflow/home-view.js",
|
|
343
|
+
"src/workflow/dashboard.js",
|
|
344
|
+
"tests/workflow-home-model.test.js",
|
|
345
|
+
"tests/workflow-home-view.test.js"
|
|
346
|
+
],
|
|
347
|
+
"evidenceFor": [],
|
|
348
|
+
"prompt": "In /Users/cowcow02/Repo/bullswork/bullswarm-dash-split, mechanically extract exactly the Home model and view functions from the study into home-model.js and home-view.js, update dashboard.js imports and dispatch, preserve all public compatibility exports and output bytes, do not alter Step or existing page behavior, add focused tests, run the focused tests and npm test, and report the summary. Others share this tree: preserve their edits and do not revert unrelated work."
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
"id": "runs-extraction",
|
|
352
|
+
"kind": "mechanical",
|
|
353
|
+
"purpose": "Extract Runs view into a dedicated module",
|
|
354
|
+
"dependsOn": ["home-extraction"],
|
|
355
|
+
"affects": ["requirement-1"],
|
|
356
|
+
"ownedFiles": [
|
|
357
|
+
"src/workflow/runs-view.js",
|
|
358
|
+
"src/workflow/dashboard.js",
|
|
359
|
+
"tests/workflow-runs-view.test.js"
|
|
360
|
+
],
|
|
361
|
+
"evidenceFor": [],
|
|
362
|
+
"prompt": "In /Users/cowcow02/Repo/bullswork/bullswarm-dash-split, mechanically extract exactly the Runs view functions from the study into runs-view.js, consume activeRunLines from home-view.js, preserve the legacy renderDashboard adapter and all existing output, add focused tests, run the focused tests and npm test, and report the summary. Others share this tree: preserve their edits and do not revert unrelated work."
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
"id": "run-extraction",
|
|
366
|
+
"kind": "mechanical",
|
|
367
|
+
"purpose": "Extract Run model and view into dedicated modules",
|
|
368
|
+
"dependsOn": ["runs-extraction"],
|
|
369
|
+
"affects": ["requirement-1"],
|
|
370
|
+
"ownedFiles": [
|
|
371
|
+
"src/workflow/run-model.js",
|
|
372
|
+
"src/workflow/run-view.js",
|
|
373
|
+
"src/workflow/dashboard.js",
|
|
374
|
+
"tests/workflow-run-model.test.js",
|
|
375
|
+
"tests/workflow-run-view.test.js"
|
|
376
|
+
],
|
|
377
|
+
"evidenceFor": [],
|
|
378
|
+
"prompt": "In /Users/cowcow02/Repo/bullswork/bullswarm-dash-split, mechanically extract exactly the Run model and view functions from the study into run-model.js and run-view.js, preserve the Step shared-helper contract, preserve workflowPanelModel compatibility, keep hit regions and interactive behavior identical, add focused tests, run the focused tests and npm test, and report the summary. Others share this tree: preserve their edits and do not revert unrelated work."
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
"id": "integrate",
|
|
382
|
+
"kind": "integration",
|
|
383
|
+
"purpose": "Reconcile the page extractions and prove the full suite remains green",
|
|
384
|
+
"dependsOn": ["home-extraction", "runs-extraction", "run-extraction"],
|
|
385
|
+
"affects": ["requirement-1", "requirement-2"],
|
|
386
|
+
"ownedFiles": [],
|
|
387
|
+
"evidenceFor": [],
|
|
388
|
+
"prompt": "In /Users/cowcow02/Repo/bullswork/bullswarm-dash-split, inspect all dependency outputs and reconcile imports, exports, compatibility adapters, and shared-helper ownership. Use only a safe temporary fixture, never live ~/.bullswarm. Capture Home, Runs, Run, and Step raw ANSI frames before and after at widths 55, 120, and 200 with fixed inputs; compare them with cmp and diff; check hit-region widths and dispatch; run npm test; report exact commands and results."
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
"id": "verify",
|
|
392
|
+
"kind": "adversarial-acceptance",
|
|
393
|
+
"purpose": "Independently try to disprove behavioral and byte identity",
|
|
394
|
+
"dependsOn": ["integrate"],
|
|
395
|
+
"affects": [],
|
|
396
|
+
"ownedFiles": [],
|
|
397
|
+
"evidenceFor": ["requirement-1", "requirement-2"],
|
|
398
|
+
"prompt": "In /Users/cowcow02/Repo/bullswork/bullswarm-dash-split, inspect only and try to break the extraction: compare raw frames at 55, 120, and 200 columns, exercise page dispatch, narrow layouts, unknown budgets, legacy Runs, Step rendering, keyboard and mouse actions, hit regions, cache refresh, timers, and public dashboard imports. Use a safe copied fixture and never live ~/.bullswarm. Do not edit files; report any discrepancy and quote npm test evidence."
|
|
399
|
+
}
|
|
400
|
+
]
|
|
401
|
+
}
|
|
402
|
+
```
|