@defrex/autobuild 1.11.1 → 1.13.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/README.md +1 -1
- package/SPEC.md +601 -203
- package/bin/ab-build-runner.ts +8 -0
- package/docs/answering-blocked-builds.md +32 -2
- package/docs/architecture.md +188 -57
- package/docs/assets/headline-wide.png +0 -0
- package/docs/cli.md +1 -1
- package/docs/configuration.md +120 -23
- package/docs/dispatcher.md +19 -8
- package/docs/integration-overview.md +1 -1
- package/docs/integration-tree.md +33 -18
- package/docs/merge-policy.md +7 -2
- package/docs/operating.md +5 -3
- package/docs/operator-api.md +48 -25
- package/docs/operator-surfaces.md +39 -3
- package/docs/optimization-nodes.md +10 -8
- package/docs/plugin-authoring.md +46 -18
- package/docs/remote-store-protocol.md +51 -12
- package/docs/remote-ticket-protocol.md +85 -38
- package/docs/restacking.md +48 -3
- package/docs/setup.md +2 -1
- package/docs/ticket-migration.md +2 -2
- package/docs/ticket-sources.md +23 -8
- package/docs/tickets.md +4 -4
- package/docs/troubleshooting.md +17 -2
- package/docs/verification.md +3 -1
- package/package.json +3 -3
- package/packages/core/src/cli/ambient-errors.ts +17 -0
- package/packages/core/src/cli/bounded-io.ts +174 -0
- package/packages/core/src/cli/build-control.ts +72 -6
- package/packages/core/src/cli/dashboard/actions.ts +4 -0
- package/packages/core/src/cli/dashboard/integration-row.ts +43 -19
- package/packages/core/src/cli/dashboard/model.ts +93 -29
- package/packages/core/src/cli/dashboard/poll.ts +231 -34
- package/packages/core/src/cli/dashboard/queue.ts +21 -10
- package/packages/core/src/cli/dashboard/render.ts +14 -37
- package/packages/core/src/cli/dashboard/row-text.ts +26 -8
- package/packages/core/src/cli/dashboard/tone-ansi.ts +39 -0
- package/packages/core/src/cli/dashboard/vocabulary.ts +165 -20
- package/packages/core/src/cli/dispatch-frontend.ts +2 -1
- package/packages/core/src/cli/dispatch-handoff.ts +41 -10
- package/packages/core/src/cli/dispatch-launch-contract.ts +5 -0
- package/packages/core/src/cli/dispatch-launcher-cadence.ts +80 -0
- package/packages/core/src/cli/dispatch-launcher.ts +9 -10
- package/packages/core/src/cli/dispatch-preflight.ts +12 -3
- package/packages/core/src/cli/dispatch-release-observer.ts +53 -0
- package/packages/core/src/cli/dispatch-runtime-cache.ts +204 -82
- package/packages/core/src/cli/dispatch-runtime-dependencies.ts +250 -43
- package/packages/core/src/cli/dispatch-tickets.ts +33 -12
- package/packages/core/src/cli/dispatch-upgrade-install.ts +36 -16
- package/packages/core/src/cli/dispatch-upgrade-source.ts +8 -2
- package/packages/core/src/cli/dispatch-yield-observer.ts +82 -0
- package/packages/core/src/cli/dispatch.ts +595 -149
- package/packages/core/src/cli/env.ts +2 -15
- package/packages/core/src/cli/help.ts +43 -28
- package/packages/core/src/cli/main.ts +11 -7
- package/packages/core/src/cli/production-store.ts +102 -0
- package/packages/core/src/cli/publication-settlement.ts +4 -0
- package/packages/core/src/cli/remote-poll.ts +22 -5
- package/packages/core/src/cli/repo-state.ts +2 -3
- package/packages/core/src/cli/repository-status.ts +44 -28
- package/packages/core/src/cli/sessionless-store.ts +26 -0
- package/packages/core/src/cli/status.ts +188 -47
- package/packages/core/src/cli/store-opening.ts +26 -57
- package/packages/core/src/cli/store-ref.ts +6 -1
- package/packages/core/src/cli/ticket-start.ts +3 -3
- package/packages/core/src/cli/ticket.ts +12 -11
- package/packages/core/src/cli/wait.ts +8 -28
- package/packages/core/src/cli/watch.ts +113 -50
- package/packages/core/src/config/reference-metadata.ts +7 -1
- package/packages/core/src/config/reference.ts +5 -2
- package/packages/core/src/config/schema.ts +51 -16
- package/packages/core/src/distribution-packaging.ts +156 -18
- package/packages/core/src/events/catalog-identity.ts +28 -0
- package/packages/core/src/events/catalog.ts +3 -9
- package/packages/core/src/events/compatibility.ts +2 -30
- package/packages/core/src/events/payloads.ts +85 -14
- package/packages/core/src/events/policy.ts +3 -0
- package/packages/core/src/events/repository.ts +15 -4
- package/packages/core/src/events/sessions.ts +1 -1
- package/packages/core/src/events/validation-error.ts +12 -0
- package/packages/core/src/kernel/__snapshots__/reducer-accumulator-shapes.json +36 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-records/0a10010ee5cf2e47.json +577 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-records/227701361be6d1e0.json +490 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-records/3064e337cc75f8d6.json +310 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-records/76e5043bae7a80ab.json +86 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-records/87a917802870bbed.json +87 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-records/9d85616e5b9e24c1.json +500 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-records/a1e90a969d32a367.json +307 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-records/c7c94fbe7f63cf07.json +84 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-records/da3bc91c49211eab.json +310 -0
- package/packages/core/src/kernel/auto-merge-default.ts +2 -1
- package/packages/core/src/kernel/capacity-build.ts +21 -0
- package/packages/core/src/kernel/clean-restack-policy.ts +40 -0
- package/packages/core/src/kernel/discard-in-flight.ts +13 -0
- package/packages/core/src/kernel/dispatch-capacity.ts +578 -235
- package/packages/core/src/kernel/done-escalations.ts +269 -0
- package/packages/core/src/kernel/engine.ts +30 -17
- package/packages/core/src/kernel/integration-landing.ts +24 -4
- package/packages/core/src/kernel/integration-stack.ts +39 -0
- package/packages/core/src/kernel/janitor-failure.ts +20 -1
- package/packages/core/src/kernel/log-index-value.ts +3 -0
- package/packages/core/src/kernel/log-index.ts +41 -2
- package/packages/core/src/kernel/measurement.ts +24 -0
- package/packages/core/src/kernel/open-pr-backpressure.ts +3 -3
- package/packages/core/src/kernel/read-facts.ts +8 -370
- package/packages/core/src/kernel/reducer-registry.ts +43 -125
- package/packages/core/src/kernel/reducer-revisions.ts +18 -0
- package/packages/core/src/kernel/reducer-value-entry.ts +98 -0
- package/packages/core/src/kernel/reducer-value-index.ts +75 -0
- package/packages/core/src/kernel/reducer.ts +84 -16
- package/packages/core/src/kernel/reopen-state.ts +10 -0
- package/packages/core/src/kernel/repository-attention.ts +14 -5
- package/packages/core/src/kernel/repository-read-facts.ts +375 -0
- package/packages/core/src/kernel/ticket-starts.ts +15 -4
- package/packages/core/src/kernel/verify-stage-state.ts +145 -3
- package/packages/core/src/kernel/verify-stages.ts +46 -7
- package/packages/core/src/operator/attention.ts +28 -3
- package/packages/core/src/operator/done-escalations.ts +38 -0
- package/packages/core/src/operator/presentation.ts +14 -1
- package/packages/core/src/operator/protocol.ts +8 -5
- package/packages/core/src/operator/query.ts +72 -57
- package/packages/core/src/operator/registry.ts +19 -15
- package/packages/core/src/operator/ticket-start.ts +8 -7
- package/packages/core/src/operator/tickets.ts +28 -9
- package/packages/core/src/plugin-sdk/index.ts +10 -0
- package/packages/core/src/plugins/manifest.ts +14 -1
- package/packages/core/src/ports/forge/create.ts +8 -0
- package/packages/core/src/ports/forge/github-transport.ts +5 -1
- package/packages/core/src/ports/forge/github.ts +3 -0
- package/packages/core/src/ports/tickets/contract.ts +147 -76
- package/packages/core/src/ports/tickets/create.ts +47 -7
- package/packages/core/src/ports/tickets/fake.ts +8 -4
- package/packages/core/src/ports/tickets/file-codec.ts +4 -3
- package/packages/core/src/ports/tickets/file.ts +7 -3
- package/packages/core/src/ports/tickets/github.ts +1 -0
- package/packages/core/src/ports/tickets/grants.ts +11 -3
- package/packages/core/src/ports/tickets/hosted-index.ts +5 -0
- package/packages/core/src/ports/tickets/linear.ts +28 -9
- package/packages/core/src/ports/tickets/migration.ts +4 -4
- package/packages/core/src/ports/tickets/operations.ts +4 -2
- package/packages/core/src/ports/tickets/priority-labels.ts +213 -0
- package/packages/core/src/ports/tickets/priority.ts +127 -21
- package/packages/core/src/ports/tickets/remote-protocol.ts +10 -0
- package/packages/core/src/ports/tickets/remote.ts +104 -11
- package/packages/core/src/ports/tickets/revision.ts +5 -3
- package/packages/core/src/ports/tickets/search.ts +9 -0
- package/packages/core/src/ports/tickets/tree.ts +8 -6
- package/packages/core/src/ports/types.ts +30 -15
- package/packages/core/src/ports/workspace/build-execution.ts +4 -0
- package/packages/core/src/ports/workspace/builtin-capabilities.ts +4 -0
- package/packages/core/src/ports/workspace/create.ts +16 -3
- package/packages/core/src/ports/workspace/execution-exit-marker.ts +41 -0
- package/packages/core/src/ports/workspace/fake.ts +15 -3
- package/packages/core/src/ports/workspace/recovery-step.ts +101 -0
- package/packages/core/src/ports/workspace/vercel-sandbox.ts +510 -145
- package/packages/core/src/processes/build-execution-state.ts +4 -0
- package/packages/core/src/processes/build-runner.ts +14 -1
- package/packages/core/src/processes/dispatcher.ts +777 -288
- package/packages/core/src/processes/execution-no-progress.ts +1 -0
- package/packages/core/src/processes/execution-settlement.ts +1 -0
- package/packages/core/src/processes/harvest-runner.ts +12 -7
- package/packages/core/src/processes/infrastructure-failure-budget.ts +7 -2
- package/packages/core/src/processes/invocation-budget.ts +176 -0
- package/packages/core/src/processes/publication-loss.ts +38 -3
- package/packages/core/src/processes/workspace-preservation.ts +86 -15
- package/packages/core/src/store/contract.ts +81 -3
- package/packages/core/src/store/event-reads.ts +30 -1
- package/packages/core/src/store/local/capabilities.ts +115 -0
- package/packages/core/src/store/local/store.ts +86 -56
- package/packages/core/src/store/reduced-reads.ts +32 -1
- package/packages/core/src/store/reducer-value-read.ts +235 -0
- package/packages/core/src/store/reducer-value-shapes.json +6722 -6475
- package/packages/core/src/store/reducer-value-validation.ts +181 -33
- package/packages/core/src/store/reducer-values.ts +36 -204
- package/packages/core/src/store/remote/client.ts +169 -29
- package/packages/core/src/store/remote/compatibility.ts +113 -56
- package/packages/core/src/store/remote/credentials.ts +4 -1
- package/packages/core/src/store/remote/protocol.ts +3 -0
- package/packages/core/src/store/remote/released-clients.json +22 -0
- package/packages/core/src/store/remote/released-reducer-values/1.12.0.json +35806 -0
- package/packages/core/src/store/remote/released-reducer-values/1.13.0.json +35966 -0
- package/packages/core/src/store/remote/released-reducer-values/index.ts +20 -16
- package/packages/core/src/store/remote/released-value-policy.ts +144 -0
- package/packages/core/src/store/remote/retry.ts +406 -0
- package/packages/core/src/store/rollup-lease.ts +41 -0
- package/packages/core/src/store/rollups.ts +7 -38
- package/packages/core/src/store/snapshots.ts +1 -1
- package/packages/core/src/testing/dispatch-read-budget.ts +409 -14
- package/packages/core/src/testing/import-graph.ts +78 -0
- package/packages/core/src/testing/index.ts +2 -0
- package/packages/core/src/testing/invocation-budget.ts +42 -0
- package/packages/core/src/testing/reduced-read-budget.ts +602 -40
- package/packages/core/src/testing/released-value-coverage.ts +423 -0
- package/packages/core/src/testing/slot-agreement.ts +52 -0
- package/packages/core/src/web/assets/app.js +5 -5
- package/packages/core/src/web/overview-source.ts +19 -6
- package/skills/guide/SKILL.md +245 -103
- package/skills/guide/references/integration-tree.md +33 -18
- package/skills/guide/references/merge-policy.md +7 -2
- package/skills/guide/references/operator-api.md +48 -25
- package/skills/guide/references/optimization-nodes.md +10 -8
- package/skills/guide/references/plugin-authoring.md +46 -18
- package/skills/guide/references/remote-store-protocol.md +51 -12
- package/skills/guide/references/remote-ticket-protocol.md +85 -38
- package/skills/guide/references/restacking.md +48 -3
- package/skills/guide/references/setup.md +2 -1
- package/skills/guide/references/ticket-migration.md +2 -2
- package/skills/operate/SKILL.md +114 -65
- package/skills/plan/SKILL.md +4 -3
- package/skills/spec/SKILL.md +9 -5
- package/skills/tickets/SKILL.md +25 -17
- package/templates/hosted-service/package.json +2 -2
|
@@ -28,11 +28,18 @@ import {
|
|
|
28
28
|
import { readBuildFacts } from '../store/reduced-reads'
|
|
29
29
|
import {
|
|
30
30
|
buildPriority,
|
|
31
|
+
markedPriority,
|
|
31
32
|
slotRequest,
|
|
33
|
+
slotState,
|
|
32
34
|
slotWaitText,
|
|
35
|
+
type CapacityBuild,
|
|
36
|
+
type MarkedPriority,
|
|
33
37
|
type SlotRequest,
|
|
38
|
+
type SlotState,
|
|
34
39
|
} from '../kernel/dispatch-capacity'
|
|
35
|
-
import {
|
|
40
|
+
import { capacityBuildFromFacts } from '../kernel/capacity-build'
|
|
41
|
+
import { openBuildWorkspace, provisionMarkerReducer } from '../processes/dispatcher-selectors'
|
|
42
|
+
import { PRIORITY_MARKS } from './dashboard/queue'
|
|
36
43
|
import {
|
|
37
44
|
ticketWaitStatus,
|
|
38
45
|
ticketWaitText,
|
|
@@ -70,10 +77,11 @@ import type { BuildFacts } from '../processes/repo-view'
|
|
|
70
77
|
* presentation helper exposes that divergence without folding it into status
|
|
71
78
|
* or lease health.
|
|
72
79
|
*
|
|
73
|
-
*
|
|
74
|
-
* "
|
|
75
|
-
*
|
|
76
|
-
*
|
|
80
|
+
* Text output colors only the status word, with its shared tone (SPEC §14
|
|
81
|
+
* "Status words"), and only on an interactive terminal; it never does under
|
|
82
|
+
* `--json`, through a pipe or a redirect, or when a caller omits `color`. The
|
|
83
|
+
* word itself always carries the meaning, so the output is understandable
|
|
84
|
+
* without color, and machine readers never see an escape sequence.
|
|
77
85
|
*/
|
|
78
86
|
import { join } from 'node:path'
|
|
79
87
|
import type { AbEvent } from '../events/catalog'
|
|
@@ -98,7 +106,16 @@ import { sameLandingCandidate } from '../kernel/landing-state'
|
|
|
98
106
|
import type { PipelineSourceMeta } from '../config/pipeline-source'
|
|
99
107
|
import { openExecution } from '../processes/execution-settlement'
|
|
100
108
|
import { currentLandingWaitReasonFrom } from '../kernel/auto-merge'
|
|
101
|
-
import {
|
|
109
|
+
import {
|
|
110
|
+
autoMergeDisplay,
|
|
111
|
+
effectiveStatus,
|
|
112
|
+
statusBasis,
|
|
113
|
+
type AutoMergeDisplay,
|
|
114
|
+
type EffectiveStatus,
|
|
115
|
+
} from './dashboard/model'
|
|
116
|
+
import { buildStatusText, type DashboardTone } from './dashboard/vocabulary'
|
|
117
|
+
import { paint, paintTone } from './dashboard/tone-ansi'
|
|
118
|
+
import type { TerminalOut } from './terminal'
|
|
102
119
|
import { decideNextFromFacts } from '../kernel/engine'
|
|
103
120
|
import {
|
|
104
121
|
reduceBuild,
|
|
@@ -181,17 +198,26 @@ export interface BuildSummary {
|
|
|
181
198
|
lease: LeaseInfo
|
|
182
199
|
/** Durable-event progress, separate from mutable lease renewal. */
|
|
183
200
|
progress: BuildProgress
|
|
184
|
-
/** A node's or parked build's runner request, admitted ahead of
|
|
185
|
-
* ticket claims (
|
|
201
|
+
/** A node's or parked build's runner request, admitted ahead of its own
|
|
202
|
+
* level's ticket claims (higher levels first: SPEC §12 "Slot admission
|
|
203
|
+
* order"). */
|
|
186
204
|
slotWait?: SlotRequest
|
|
187
|
-
/** The build's slot
|
|
188
|
-
|
|
205
|
+
/** The build's slot state by the rules the dispatcher admits work by
|
|
206
|
+
* (SPEC §12 "What holds a slot"). Absent for a `done` build, and unknown
|
|
207
|
+
* (never `none`) when absent on any other: a value from an older server,
|
|
208
|
+
* or a caller without the build's capacity facts. */
|
|
209
|
+
slot?: SlotState
|
|
210
|
+
/** The build's slot-admission level; omitted means normal. */
|
|
211
|
+
priority?: MarkedPriority
|
|
189
212
|
/** The build's ticket wait while it is requested, open, or ended and not
|
|
190
213
|
* yet resumed (SPEC §11 "Ticket waits"); omitted otherwise. */
|
|
191
214
|
wait?: TicketWaitStatus
|
|
192
215
|
/** Set when the open ticket wait's escalation is the only one open: the
|
|
193
216
|
* dashboards' `waiting` status. `status` stays the reducer's `blocked`. */
|
|
194
217
|
waitOnly?: true
|
|
218
|
+
/** The status word every surface shows (SPEC §14 "Status words"), with its
|
|
219
|
+
* tone and note. Absent for a `done` build, and from an older server. */
|
|
220
|
+
statusWord?: { word: string; tone: DashboardTone; note?: string }
|
|
195
221
|
/** Why the operator held the merge, while a hold that gave one stands. */
|
|
196
222
|
holdReason?: string
|
|
197
223
|
/** An operator reopened this leaf and it has not settled again (§15.7). */
|
|
@@ -424,6 +450,22 @@ function measurementSummary(state: BuildState): MeasurementSummary | undefined {
|
|
|
424
450
|
}
|
|
425
451
|
}
|
|
426
452
|
|
|
453
|
+
/** A nonterminal build's status word from its reduced state and slot. */
|
|
454
|
+
function summaryStatusWord(
|
|
455
|
+
state: BuildState,
|
|
456
|
+
slot: SlotState | undefined,
|
|
457
|
+
): BuildSummary['statusWord'] {
|
|
458
|
+
const status = effectiveStatus(state)
|
|
459
|
+
const basis = statusBasis(state)
|
|
460
|
+
if (status === 'done' || status === 'aborted' || basis === undefined) return undefined
|
|
461
|
+
const text = buildStatusText({ status, basis, ...(slot !== undefined ? { slot } : {}) })
|
|
462
|
+
return {
|
|
463
|
+
word: text.word,
|
|
464
|
+
tone: text.tone,
|
|
465
|
+
...(text.note !== undefined ? { note: text.note } : {}),
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
|
|
427
469
|
/**
|
|
428
470
|
* The summary over an ALREADY-reduced state — so `detail` reduces the log
|
|
429
471
|
* once and builds both projections from it, rather than reducing twice.
|
|
@@ -432,8 +474,10 @@ export function summarizeFrom(
|
|
|
432
474
|
record: BuildRecord,
|
|
433
475
|
state: BuildState,
|
|
434
476
|
now: Date,
|
|
435
|
-
|
|
477
|
+
capacity?: CapacityBuild,
|
|
436
478
|
): BuildSummary {
|
|
479
|
+
const slotWait = capacity ? slotRequest(capacity, now) : undefined
|
|
480
|
+
const slot = capacity ? slotState(capacity, now) : undefined
|
|
437
481
|
// `phase`, `round`, and `attempt` describe ONE phase occurrence, so they come
|
|
438
482
|
// from ONE source: the in-flight phase, else the last completed one — the
|
|
439
483
|
// same `currentPhase ?? lastCompletedPhase` the reducer uses to derive
|
|
@@ -457,6 +501,7 @@ export function summarizeFrom(
|
|
|
457
501
|
const heldBecause = holdReason(state.landing)
|
|
458
502
|
const reopened = reopenedSummary(state)
|
|
459
503
|
const ciFailure = currentCiFailure(state)
|
|
504
|
+
const word = summaryStatusWord(state, slot)
|
|
460
505
|
return {
|
|
461
506
|
slug: record.slug,
|
|
462
507
|
...buildVocabulary(state),
|
|
@@ -508,9 +553,13 @@ export function summarizeFrom(
|
|
|
508
553
|
lease: leaseInfo(record, now),
|
|
509
554
|
progress: buildProgress(record, state),
|
|
510
555
|
...(slotWait ? { slotWait } : {}),
|
|
511
|
-
...(
|
|
556
|
+
...(slot ? { slot } : {}),
|
|
557
|
+
...(markedPriority(buildPriority(state)) !== undefined
|
|
558
|
+
? { priority: markedPriority(buildPriority(state))! }
|
|
559
|
+
: {}),
|
|
512
560
|
...(wait !== undefined ? { wait } : {}),
|
|
513
561
|
...(effectiveStatus(state) === 'waiting' ? { waitOnly: true as const } : {}),
|
|
562
|
+
...(word !== undefined ? { statusWord: word } : {}),
|
|
514
563
|
...(heldBecause !== undefined ? { holdReason: heldBecause } : {}),
|
|
515
564
|
...(reopened !== undefined ? { reopened } : {}),
|
|
516
565
|
...(ciFailure !== undefined
|
|
@@ -533,7 +582,20 @@ export function summarizeFrom(
|
|
|
533
582
|
* happening now rather than the last thing that finished.
|
|
534
583
|
*/
|
|
535
584
|
export function summarize(record: BuildRecord, events: AbEvent[], now: Date): BuildSummary {
|
|
536
|
-
|
|
585
|
+
const state = reduceBuild(events)
|
|
586
|
+
return summarizeFrom(record, state, now, capacityFromEvents(record, state, events))
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
/** A build's capacity facts from its whole log, as `buildDashboard` derives
|
|
590
|
+
* them: pure, for the event-array convenience callers. */
|
|
591
|
+
function capacityFromEvents(record: BuildRecord, state: BuildState, events: AbEvent[]) {
|
|
592
|
+
return {
|
|
593
|
+
record,
|
|
594
|
+
state,
|
|
595
|
+
workspace: openBuildWorkspace(events) !== null,
|
|
596
|
+
provisioning: provisionMarkerReducer.reduce(events) !== undefined,
|
|
597
|
+
restackDue: landingRestackDue(state, indexLog(events)),
|
|
598
|
+
} satisfies CapacityBuild
|
|
537
599
|
}
|
|
538
600
|
|
|
539
601
|
/** Summary plus the detail fields; `eventCount` appends the newest n events. */
|
|
@@ -551,10 +613,11 @@ export function detail(
|
|
|
551
613
|
decision?: BuildDecisionProjection,
|
|
552
614
|
streams?: readonly StreamRecord[],
|
|
553
615
|
): BuildDetail {
|
|
616
|
+
const state = reduceBuild(events)
|
|
554
617
|
return detailFromFacts(
|
|
555
618
|
record,
|
|
556
619
|
{
|
|
557
|
-
state
|
|
620
|
+
state,
|
|
558
621
|
runnerAttaches: buildReadFactsReducer.reduce(events).runnerAttaches,
|
|
559
622
|
log: indexLog(events),
|
|
560
623
|
observations: events
|
|
@@ -570,6 +633,7 @@ export function detail(
|
|
|
570
633
|
eventCount === undefined ? undefined : events.slice(-eventCount),
|
|
571
634
|
decision,
|
|
572
635
|
streams,
|
|
636
|
+
capacityFromEvents(record, state, events),
|
|
573
637
|
)
|
|
574
638
|
}
|
|
575
639
|
|
|
@@ -645,6 +709,7 @@ export function detailFromFacts(
|
|
|
645
709
|
events?: AbEvent[],
|
|
646
710
|
decision?: BuildDecisionProjection,
|
|
647
711
|
streams?: readonly StreamRecord[],
|
|
712
|
+
capacity?: CapacityBuild,
|
|
648
713
|
): BuildDetail {
|
|
649
714
|
const state = facts.state
|
|
650
715
|
const streamStatus = new Map<string, { stream?: string; status: 'open' | 'closed' }>()
|
|
@@ -657,7 +722,7 @@ export function detailFromFacts(
|
|
|
657
722
|
})
|
|
658
723
|
}
|
|
659
724
|
}
|
|
660
|
-
const summary = summarizeFrom(record, state, now)
|
|
725
|
+
const summary = summarizeFrom(record, state, now, capacity)
|
|
661
726
|
// §15.6-A: only the CURRENT cycle's results describe the current code.
|
|
662
727
|
// Without this filter an earlier cycle's passes read as current — wrong, and
|
|
663
728
|
// wrong in the reassuring direction.
|
|
@@ -866,16 +931,26 @@ function viaMarker(actor: Actor): string {
|
|
|
866
931
|
return `human (via ${actor.via.kind === 'session' ? `session ${actor.via.id}` : `mcp ${actor.via.client}`})`
|
|
867
932
|
}
|
|
868
933
|
|
|
869
|
-
|
|
934
|
+
/** A table cell: plain text, or text painted with escapes whose visible
|
|
935
|
+
* width is `plain`'s. Padding always goes outside the escapes. */
|
|
936
|
+
type Cell = string | { plain: string; painted: string }
|
|
937
|
+
|
|
938
|
+
function padColumns(rows: Cell[][]): string[] {
|
|
939
|
+
const plain = (cell: Cell) => (typeof cell === 'string' ? cell : cell.plain)
|
|
940
|
+
const painted = (cell: Cell) => (typeof cell === 'string' ? cell : cell.painted)
|
|
870
941
|
const widths: number[] = []
|
|
871
942
|
for (const row of rows) {
|
|
872
943
|
row.forEach((cell, i) => {
|
|
873
|
-
widths[i] = Math.max(widths[i] ?? 0, cell.length)
|
|
944
|
+
widths[i] = Math.max(widths[i] ?? 0, plain(cell).length)
|
|
874
945
|
})
|
|
875
946
|
}
|
|
876
947
|
return rows.map((row) =>
|
|
877
948
|
row
|
|
878
|
-
.map((cell, i) =>
|
|
949
|
+
.map((cell, i) =>
|
|
950
|
+
i === row.length - 1
|
|
951
|
+
? painted(cell)
|
|
952
|
+
: `${painted(cell)}${' '.repeat(Math.max(0, (widths[i] ?? 0) - plain(cell).length))}`,
|
|
953
|
+
)
|
|
879
954
|
.join(' ')
|
|
880
955
|
.trimEnd(),
|
|
881
956
|
)
|
|
@@ -886,12 +961,17 @@ function padColumns(rows: string[][]): string[] {
|
|
|
886
961
|
* is nothing to show, so an empty result is an honest answer rather than a
|
|
887
962
|
* blank that reads like a bug.
|
|
888
963
|
*/
|
|
889
|
-
export function renderSummaries(
|
|
964
|
+
export function renderSummaries(
|
|
965
|
+
summaries: BuildSummary[],
|
|
966
|
+
now: Date,
|
|
967
|
+
emptyNote: string,
|
|
968
|
+
opts: { color?: boolean } = {},
|
|
969
|
+
): string[] {
|
|
890
970
|
if (summaries.length === 0) return [emptyNote]
|
|
891
971
|
// The two free-text columns (ticket title, PR link) go last, where their
|
|
892
972
|
// width costs no alignment on the scannable columns to their left.
|
|
893
|
-
const rows:
|
|
894
|
-
['BUILD', 'STATUS', 'PHASE', 'LEASE', 'HEARTBEAT', 'PROGRESS', 'TICKET', 'PR'],
|
|
973
|
+
const rows: Cell[][] = [
|
|
974
|
+
['BUILD', 'STATUS', 'SLOT', 'PHASE', 'LEASE', 'HEARTBEAT', 'PROGRESS', 'TICKET', 'PR'],
|
|
895
975
|
]
|
|
896
976
|
for (const summary of summaries) {
|
|
897
977
|
const progressAge =
|
|
@@ -905,7 +985,12 @@ export function renderSummaries(summaries: BuildSummary[], now: Date, emptyNote:
|
|
|
905
985
|
: ''
|
|
906
986
|
rows.push([
|
|
907
987
|
summary.slug,
|
|
908
|
-
|
|
988
|
+
statusCell(
|
|
989
|
+
summary,
|
|
990
|
+
summary.priority !== undefined ? ` ${PRIORITY_MARKS[summary.priority]}` : '',
|
|
991
|
+
opts.color,
|
|
992
|
+
),
|
|
993
|
+
slotText(summary) ?? '—',
|
|
909
994
|
summary.kind === 'integration'
|
|
910
995
|
? `${summary.optimization ? treeVocabulary.optimizationKind : treeVocabulary.integrationKind} ${summary.integration ?? ''}${slotWait}`
|
|
911
996
|
: `${phaseCell(summary)}${slotWait}${ticketWait}`,
|
|
@@ -941,14 +1026,67 @@ export function renderSummaries(summaries: BuildSummary[], now: Date, emptyNote:
|
|
|
941
1026
|
})
|
|
942
1027
|
}
|
|
943
1028
|
|
|
944
|
-
/**
|
|
945
|
-
*
|
|
946
|
-
function
|
|
947
|
-
|
|
1029
|
+
/** A summary's slot state in neutral raw terms, or undefined for a `done`
|
|
1030
|
+
* build. An absent value on any other build is `unknown`, never `none`. */
|
|
1031
|
+
function slotText(
|
|
1032
|
+
summary: BuildSummary,
|
|
1033
|
+
marked = (text: string, level: MarkedPriority) => `${text} ${level}`,
|
|
1034
|
+
) {
|
|
1035
|
+
if (summary.status === 'done') return undefined
|
|
1036
|
+
const slot = summary.slot
|
|
1037
|
+
if (slot === undefined) return 'unknown'
|
|
1038
|
+
if (slot.state !== 'requested') return slot.state
|
|
1039
|
+
const text = `requested ${slot.request}`
|
|
1040
|
+
return slot.priority !== undefined ? marked(text, slot.priority) : text
|
|
1041
|
+
}
|
|
1042
|
+
|
|
1043
|
+
/** The status word text renderers print with its note (SPEC §14 "Status
|
|
1044
|
+
* words"), or a `done` build's reducer status. A summary from an older server
|
|
1045
|
+
* carries no `statusWord`; its word is chosen from the fields it does carry. */
|
|
1046
|
+
function summaryStatusText(summary: BuildSummary): BuildSummary['statusWord'] | undefined {
|
|
1047
|
+
if (summary.statusWord !== undefined) return summary.statusWord
|
|
1048
|
+
const status: EffectiveStatus | undefined = summary.waitOnly
|
|
1049
|
+
? 'waiting'
|
|
1050
|
+
: summary.status === 'aborted'
|
|
1051
|
+
? 'cleaning'
|
|
1052
|
+
: summary.status === 'done'
|
|
1053
|
+
? undefined
|
|
1054
|
+
: summary.status
|
|
1055
|
+
if (status === undefined) return undefined
|
|
1056
|
+
const text = buildStatusText({
|
|
1057
|
+
status,
|
|
1058
|
+
...(summary.slot !== undefined ? { slot: summary.slot } : {}),
|
|
1059
|
+
})
|
|
1060
|
+
return {
|
|
1061
|
+
word: text.word,
|
|
1062
|
+
tone: text.tone,
|
|
1063
|
+
...(text.note !== undefined ? { note: text.note } : {}),
|
|
1064
|
+
}
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
/** The STATUS text: the word painted in its tone on a color terminal, its
|
|
1068
|
+
* note dim, and `suffix` plain. */
|
|
1069
|
+
function statusCell(summary: BuildSummary, suffix: string, color = false): Cell {
|
|
1070
|
+
const word = summaryStatusText(summary)
|
|
1071
|
+
if (word === undefined) return `${summary.status}${suffix}`
|
|
1072
|
+
const note = word.note !== undefined ? ` (${word.note})` : ''
|
|
1073
|
+
return {
|
|
1074
|
+
plain: `${word.word}${note}${suffix}`,
|
|
1075
|
+
painted: `${paintTone(word.word, word.tone, color)}${paint(note, 'dim', color && note !== '')}${suffix}`,
|
|
1076
|
+
}
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
/** Whether `ab builds` and `ab build status` color the status word: only on
|
|
1080
|
+
* an interactive terminal, and never under `--json`. */
|
|
1081
|
+
export function statusColor(
|
|
1082
|
+
terminal: Pick<TerminalOut, 'interactive'> | undefined,
|
|
1083
|
+
json: boolean,
|
|
1084
|
+
): boolean {
|
|
1085
|
+
return terminal?.interactive === true && !json
|
|
948
1086
|
}
|
|
949
1087
|
|
|
950
1088
|
/** Labeled sections, each omitted when absent ("when each is available"). */
|
|
951
|
-
export function renderDetail(d: BuildDetail, now: Date): string[] {
|
|
1089
|
+
export function renderDetail(d: BuildDetail, now: Date, opts: { color?: boolean } = {}): string[] {
|
|
952
1090
|
const lines: string[] = [`build ${d.slug}`]
|
|
953
1091
|
if (d.nodePolling)
|
|
954
1092
|
lines.push(
|
|
@@ -1035,13 +1173,16 @@ export function renderDetail(d: BuildDetail, now: Date): string[] {
|
|
|
1035
1173
|
lines.push(` unsafe merge ${proof.sha}: ${proof.missing.join(', ') || proof.build}`)
|
|
1036
1174
|
}
|
|
1037
1175
|
}
|
|
1038
|
-
|
|
1176
|
+
const status = statusCell(d, d.outcome !== undefined ? ` (${d.outcome})` : '', opts.color)
|
|
1177
|
+
lines.push(` status: ${typeof status === 'string' ? status : status.painted}`)
|
|
1178
|
+
const slot = slotText(d, (text, level) => `${text} (${level})`)
|
|
1179
|
+
if (slot !== undefined) lines.push(` slot: ${slot}`)
|
|
1039
1180
|
lines.push(` phase: ${phaseCell(d)}`)
|
|
1040
1181
|
if (d.reopened !== undefined)
|
|
1041
1182
|
lines.push(
|
|
1042
1183
|
` reopened: ${safeStatusText(reopenedText(d.reopened).replace(/^reopened /, ''))} (${d.reopened.at})`,
|
|
1043
1184
|
)
|
|
1044
|
-
if (d.priority
|
|
1185
|
+
if (d.priority !== undefined) lines.push(` priority: ${d.priority}`)
|
|
1045
1186
|
if (d.reviewRoundCeilings !== undefined) {
|
|
1046
1187
|
const ceilings = [
|
|
1047
1188
|
...(d.reviewRoundCeilings.plan !== undefined ? [`plan ${d.reviewRoundCeilings.plan}`] : []),
|
|
@@ -1317,6 +1458,8 @@ export function statusFilter(all?: boolean, queued?: boolean): BuildStatus[] {
|
|
|
1317
1458
|
export interface AbBuildsOpts extends StatusOpts {
|
|
1318
1459
|
queued?: boolean
|
|
1319
1460
|
all?: boolean
|
|
1461
|
+
/** Color the status word with its tone (`statusColor`); default plain. */
|
|
1462
|
+
color?: boolean
|
|
1320
1463
|
}
|
|
1321
1464
|
|
|
1322
1465
|
/** `ab builds` — this repo's builds, active by default. Read-only. */
|
|
@@ -1372,21 +1515,7 @@ export async function abBuilds(opts: AbBuildsOpts): Promise<void> {
|
|
|
1372
1515
|
// exactly — so it keeps its per-build history read (correct, just not
|
|
1373
1516
|
// accelerated).
|
|
1374
1517
|
const facts = (await readBuildFacts(store, record.slug)).value
|
|
1375
|
-
const summary = summarizeFrom(
|
|
1376
|
-
record,
|
|
1377
|
-
facts.state,
|
|
1378
|
-
now,
|
|
1379
|
-
slotRequest(
|
|
1380
|
-
{
|
|
1381
|
-
record,
|
|
1382
|
-
state: facts.state,
|
|
1383
|
-
workspace: facts.workspace !== null,
|
|
1384
|
-
provisioning: facts.provisionMarker !== undefined,
|
|
1385
|
-
restackDue: landingRestackDue(facts.state, facts.log),
|
|
1386
|
-
},
|
|
1387
|
-
now,
|
|
1388
|
-
),
|
|
1389
|
-
)
|
|
1518
|
+
const summary = summarizeFrom(record, facts.state, now, capacityBuildFromFacts(record, facts))
|
|
1390
1519
|
if (wanted.has(summary.status)) summaries.push(summary)
|
|
1391
1520
|
}
|
|
1392
1521
|
summaries.sort((a, b) => b.updatedAt.localeCompare(a.updatedAt))
|
|
@@ -1406,7 +1535,9 @@ export async function abBuilds(opts: AbBuildsOpts): Promise<void> {
|
|
|
1406
1535
|
: 'active builds'
|
|
1407
1536
|
const hint =
|
|
1408
1537
|
opts.all === true ? '' : opts.queued === true ? ' — try --all' : ' — try --queued or --all'
|
|
1409
|
-
for (const line of renderSummaries(summaries, now, `no ${scope} for ${repo}${hint}
|
|
1538
|
+
for (const line of renderSummaries(summaries, now, `no ${scope} for ${repo}${hint}`, {
|
|
1539
|
+
color: opts.color === true,
|
|
1540
|
+
})) {
|
|
1410
1541
|
opts.stdout(line)
|
|
1411
1542
|
}
|
|
1412
1543
|
})
|
|
@@ -1415,6 +1546,8 @@ export async function abBuilds(opts: AbBuildsOpts): Promise<void> {
|
|
|
1415
1546
|
export interface AbBuildStatusOpts extends StatusOpts {
|
|
1416
1547
|
slug: string
|
|
1417
1548
|
events?: number
|
|
1549
|
+
/** Color the status word with its tone (`statusColor`); default plain. */
|
|
1550
|
+
color?: boolean
|
|
1418
1551
|
}
|
|
1419
1552
|
|
|
1420
1553
|
function _openWorkspacePath(events: AbEvent[]): string | undefined {
|
|
@@ -1612,7 +1745,15 @@ export async function abBuildStatus(opts: AbBuildStatusOpts): Promise<void> {
|
|
|
1612
1745
|
} catch {
|
|
1613
1746
|
streams = undefined
|
|
1614
1747
|
}
|
|
1615
|
-
const projected = detailFromFacts(
|
|
1748
|
+
const projected = detailFromFacts(
|
|
1749
|
+
record,
|
|
1750
|
+
facts,
|
|
1751
|
+
now,
|
|
1752
|
+
events,
|
|
1753
|
+
decision,
|
|
1754
|
+
streams,
|
|
1755
|
+
capacityBuildFromFacts(record, facts),
|
|
1756
|
+
)
|
|
1616
1757
|
// Operator visibility (SPEC §16.1): which autobuild.toml the build's
|
|
1617
1758
|
// pinned pipeline came from, alongside the effective-config revision.
|
|
1618
1759
|
const configArtifact = await context.store.getArtifact(
|
|
@@ -1665,7 +1806,7 @@ export async function abBuildStatus(opts: AbBuildStatusOpts): Promise<void> {
|
|
|
1665
1806
|
opts.stdout(JSON.stringify(d, null, 2))
|
|
1666
1807
|
return
|
|
1667
1808
|
}
|
|
1668
|
-
for (const line of renderDetail(d, now)) opts.stdout(line)
|
|
1809
|
+
for (const line of renderDetail(d, now, { color: opts.color === true })) opts.stdout(line)
|
|
1669
1810
|
})
|
|
1670
1811
|
}
|
|
1671
1812
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { AccountRedactor, redactAccountStore } from '../store/account-redaction'
|
|
2
1
|
import { untilDeadline } from './watch-lifetime'
|
|
3
2
|
/**
|
|
4
3
|
* Production BuildStore composition for CLI commands.
|
|
@@ -8,48 +7,46 @@ import { untilDeadline } from './watch-lifetime'
|
|
|
8
7
|
* joins those seams to the production remote adapter and owns finite-command
|
|
9
8
|
* store lifecycle.
|
|
10
9
|
*/
|
|
11
|
-
import {
|
|
12
|
-
|
|
10
|
+
import {
|
|
11
|
+
composeProductionStore,
|
|
12
|
+
openStoreForRepoStateWith,
|
|
13
|
+
type OpenedStoreContext,
|
|
14
|
+
type OpenStoreForRepoStateOpts,
|
|
15
|
+
type StoreOpener,
|
|
16
|
+
} from './production-store'
|
|
13
17
|
import type { Exec } from '../ports/workspace/git-worktree'
|
|
14
18
|
import { RemoteBuildStore } from '../store/remote/client'
|
|
15
19
|
import { scopeLocalStoreToPhaseSession } from '../store/phase-session'
|
|
16
20
|
import type { BuildStore } from '../store/types'
|
|
17
21
|
import {
|
|
18
|
-
InvalidAmbientContextError,
|
|
19
22
|
resolveAmbientReadSession,
|
|
20
23
|
type AmbientReadSession,
|
|
21
24
|
type CliEnv,
|
|
22
25
|
type HarvestCliEnv,
|
|
23
26
|
} from './env'
|
|
24
27
|
import { resolveRepoState, type RepoStatePaths } from './repo-state'
|
|
25
|
-
import { resolveStore } from './store-ref'
|
|
26
|
-
|
|
27
|
-
/** Shared injection seam used by every command that opens a BuildStore. */
|
|
28
|
-
export type StoreOpener = (ref: string, token?: string) => BuildStore
|
|
29
28
|
|
|
30
|
-
|
|
31
|
-
// Bearer credentials are opaque. Only absence and the exact empty value mean
|
|
32
|
-
// "no token"; nonempty values are forwarded byte-for-byte.
|
|
33
|
-
return value !== undefined && value !== '' ? value : undefined
|
|
34
|
-
}
|
|
29
|
+
export type { StoreOpener } from './production-store'
|
|
35
30
|
|
|
36
31
|
/** Production local/remote composition. The low-level parser stays injectable
|
|
37
32
|
* and does not import the HTTP adapter. */
|
|
38
|
-
export const openProductionStore: StoreOpener = (ref, token) =>
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
})
|
|
44
|
-
const raw = process.env.AB_ACCOUNT_CREDENTIAL_ENVS
|
|
45
|
-
if (!raw) return store
|
|
46
|
-
const names: unknown = JSON.parse(raw)
|
|
47
|
-
if (!Array.isArray(names) || !names.every((name) => typeof name === 'string'))
|
|
48
|
-
throw new Error('Invalid account credential variable inventory')
|
|
49
|
-
return redactAccountStore(
|
|
50
|
-
store,
|
|
51
|
-
new AccountRedactor(() => names.map((name) => process.env[name])),
|
|
33
|
+
export const openProductionStore: StoreOpener = (ref, token) =>
|
|
34
|
+
composeProductionStore(
|
|
35
|
+
ref,
|
|
36
|
+
token,
|
|
37
|
+
(url, remoteToken) => new RemoteBuildStore({ url, token: remoteToken }),
|
|
52
38
|
)
|
|
39
|
+
|
|
40
|
+
/** Production composition for a bounded invocation: every remote Store
|
|
41
|
+
* request goes through `fetchFn` (normally `budgetedFetch()`), so it is
|
|
42
|
+
* cancelled at the current invocation phase's deadline. */
|
|
43
|
+
export function budgetedProductionStore(fetchFn: typeof fetch): StoreOpener {
|
|
44
|
+
return (ref, token) =>
|
|
45
|
+
composeProductionStore(
|
|
46
|
+
ref,
|
|
47
|
+
token,
|
|
48
|
+
(url, remoteToken) => new RemoteBuildStore({ url, token: remoteToken, fetchFn }),
|
|
49
|
+
)
|
|
53
50
|
}
|
|
54
51
|
|
|
55
52
|
/** Apply validated ambient authority to a selected Store handle. Remote
|
|
@@ -74,20 +71,7 @@ export function openProductionSessionStore(env: CliEnv | HarvestCliEnv): BuildSt
|
|
|
74
71
|
return scopeSelectedStoreToPhaseSession(openProductionStore(env.store, env.token), env.store, env)
|
|
75
72
|
}
|
|
76
73
|
|
|
77
|
-
export
|
|
78
|
-
store: BuildStore
|
|
79
|
-
token?: string
|
|
80
|
-
/** The validated ambient phase/Harvest identity this invocation carries, if
|
|
81
|
-
* any — the same value that scoped `store`. Exposed for commands whose
|
|
82
|
-
* repository selection also depends on ambient own-build authority. */
|
|
83
|
-
ambient?: AmbientReadSession
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
export interface OpenStoreForRepoStateOpts {
|
|
87
|
-
env: Record<string, string | undefined>
|
|
88
|
-
openStore?: StoreOpener
|
|
89
|
-
useProjectCredential?: boolean
|
|
90
|
-
}
|
|
74
|
+
export type { OpenedStoreContext, OpenStoreForRepoStateOpts } from './production-store'
|
|
91
75
|
|
|
92
76
|
/** Open from an already canonicalized state selection. Dispatch uses this form
|
|
93
77
|
* so repository topology and relative overrides are decided exactly once. */
|
|
@@ -95,22 +79,7 @@ export function openStoreForRepoState(
|
|
|
95
79
|
state: RepoStatePaths,
|
|
96
80
|
opts: OpenStoreForRepoStateOpts,
|
|
97
81
|
): OpenedStoreContext {
|
|
98
|
-
|
|
99
|
-
if (opts.env.AB_JUDGE !== undefined)
|
|
100
|
-
throw new InvalidAmbientContextError('a judge session has no read authority')
|
|
101
|
-
const token =
|
|
102
|
-
opts.useProjectCredential !== false && isRemoteStoreRef(state.storeRef)
|
|
103
|
-
? projectToken(state.storeRef, state.repo, opts.env)
|
|
104
|
-
: optionalToken(opts.env.AB_TOKEN)
|
|
105
|
-
if (!token && isRemoteStoreRef(state.storeRef) && state.configStore === state.storeRef) {
|
|
106
|
-
throw new Error('No project credential for this service; run ab connect')
|
|
107
|
-
}
|
|
108
|
-
const store = (opts.openStore ?? openProductionStore)(state.storeRef, token)
|
|
109
|
-
return {
|
|
110
|
-
...state,
|
|
111
|
-
store,
|
|
112
|
-
...(token !== undefined ? { token } : {}),
|
|
113
|
-
}
|
|
82
|
+
return openStoreForRepoStateWith(state, opts, opts.openStore ?? openProductionStore)
|
|
114
83
|
}
|
|
115
84
|
|
|
116
85
|
export interface SessionlessStoreOpts extends OpenStoreForRepoStateOpts {
|
|
@@ -8,7 +8,12 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { openLocalStore } from '../store/local/store'
|
|
10
10
|
import type { BuildStore } from '../store/types'
|
|
11
|
-
|
|
11
|
+
|
|
12
|
+
/** An http(s) reference names the remote HTTP adapter; anything else is a
|
|
13
|
+
* local filesystem path. */
|
|
14
|
+
export function isRemoteStoreRef(ref: string): boolean {
|
|
15
|
+
return /^https?:\/\//i.test(ref)
|
|
16
|
+
}
|
|
12
17
|
|
|
13
18
|
export interface ResolveStoreOpts {
|
|
14
19
|
/** Constructs the remote HTTP store (§7.2.2); production wiring is external. */
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { StartTier } from '../ports/tickets/priority'
|
|
2
2
|
import { cancelTicketStart, requestTicketStart } from '../operator/ticket-start'
|
|
3
3
|
import type { TicketSource } from '../ports/types'
|
|
4
4
|
import { buildControlUser } from './build-control'
|
|
5
5
|
import { withSessionlessStore, type SessionlessStoreOpts } from './store-opening'
|
|
6
6
|
|
|
7
|
-
/** `ab start <ticket-id> [--priority manual|urgent|normal] [--cancel]`: record
|
|
7
|
+
/** `ab start <ticket-id> [--priority manual|urgent|high|normal|low] [--cancel]`: record
|
|
8
8
|
* or cancel a durable request that the running dispatcher start one ticket,
|
|
9
9
|
* even while intake is off. */
|
|
10
10
|
export async function abTicketStart(
|
|
11
11
|
opts: SessionlessStoreOpts & {
|
|
12
12
|
id: string
|
|
13
13
|
cancel?: boolean
|
|
14
|
-
priority?:
|
|
14
|
+
priority?: StartTier
|
|
15
15
|
json?: boolean
|
|
16
16
|
stdout: (line: string) => void
|
|
17
17
|
ticketSource: () => Promise<TicketSource>
|