@defrex/autobuild 1.12.0 → 1.14.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 +465 -163
- package/bin/ab-build-runner.ts +8 -0
- package/docs/answering-blocked-builds.md +28 -4
- package/docs/architecture.md +136 -53
- package/docs/cli.md +1 -1
- package/docs/configuration.md +120 -17
- package/docs/dispatcher.md +19 -8
- package/docs/integration-overview.md +1 -1
- package/docs/integration-tree.md +12 -9
- package/docs/merge-policy.md +7 -2
- package/docs/operating.md +13 -3
- package/docs/operator-api.md +46 -23
- package/docs/operator-surfaces.md +7 -6
- package/docs/optimization-nodes.md +7 -6
- package/docs/plugin-authoring.md +46 -18
- package/docs/remote-store-protocol.md +52 -13
- 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 +32 -2
- package/docs/verification.md +3 -1
- package/package.json +3 -3
- 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 +14 -8
- package/packages/core/src/cli/dashboard/poll.ts +218 -10
- package/packages/core/src/cli/dashboard/queue.ts +21 -10
- package/packages/core/src/cli/dashboard/row-text.ts +2 -1
- package/packages/core/src/cli/dashboard/vocabulary.ts +5 -1
- package/packages/core/src/cli/dispatch-frontend.ts +2 -1
- package/packages/core/src/cli/dispatch-tickets.ts +33 -12
- package/packages/core/src/cli/dispatch.ts +547 -145
- package/packages/core/src/cli/help.ts +38 -24
- package/packages/core/src/cli/main.ts +7 -5
- 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/repository-status.ts +19 -9
- package/packages/core/src/cli/status.ts +23 -11
- package/packages/core/src/cli/store-opening.ts +12 -0
- 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/events/payloads.ts +74 -14
- package/packages/core/src/events/policy.ts +1 -0
- package/packages/core/src/events/repository.ts +33 -3
- package/packages/core/src/kernel/__snapshots__/reducer-accumulator-shapes.json +31 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/be211f0e31a65006.json.gz +0 -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/312cc4090820a612.json +1078 -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/a2780567b4989fb6.json +105 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-records/c7c94fbe7f63cf07.json +84 -0
- package/packages/core/src/kernel/clean-restack-policy.ts +40 -0
- package/packages/core/src/kernel/dispatch-capacity.ts +243 -107
- package/packages/core/src/kernel/done-escalations.ts +273 -0
- package/packages/core/src/kernel/engine.ts +28 -9
- 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/open-pr-backpressure.ts +3 -3
- package/packages/core/src/kernel/reducer-registry.ts +3 -0
- package/packages/core/src/kernel/reducer-revisions.ts +19 -0
- package/packages/core/src/kernel/reducer.ts +42 -8
- package/packages/core/src/kernel/repository-attention.ts +14 -5
- package/packages/core/src/kernel/repository-read-facts.ts +9 -0
- package/packages/core/src/kernel/ticket-starts.ts +15 -4
- 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 +1 -1
- package/packages/core/src/operator/protocol.ts +8 -5
- package/packages/core/src/operator/query.ts +33 -19
- package/packages/core/src/operator/registry.ts +17 -13
- 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 +13 -1
- 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/recovery-step.ts +101 -0
- package/packages/core/src/ports/workspace/vercel-sandbox.ts +596 -144
- 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 +841 -230
- package/packages/core/src/processes/execution-settlement.ts +25 -3
- 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/tick-publication.ts +1 -0
- package/packages/core/src/processes/workspace-preservation.ts +86 -15
- package/packages/core/src/store/contract.ts +88 -3
- package/packages/core/src/store/event-reads.ts +30 -1
- package/packages/core/src/store/reduced-reads.ts +23 -0
- package/packages/core/src/store/reducer-value-shapes.json +6759 -6490
- package/packages/core/src/store/reducer-value-validation.ts +188 -33
- 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.13.0.json +35966 -0
- package/packages/core/src/store/remote/released-reducer-values/1.14.0.json +36076 -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/repo-state-events.ts +1 -0
- package/packages/core/src/testing/dispatch-read-budget.ts +155 -11
- 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 +589 -19
- package/packages/core/src/testing/released-value-coverage.ts +423 -0
- package/packages/core/src/web/overview-source.ts +19 -6
- package/skills/guide/SKILL.md +147 -67
- package/skills/guide/references/integration-tree.md +12 -9
- package/skills/guide/references/merge-policy.md +7 -2
- package/skills/guide/references/operator-api.md +46 -23
- package/skills/guide/references/optimization-nodes.md +7 -6
- package/skills/guide/references/plugin-authoring.md +46 -18
- package/skills/guide/references/remote-store-protocol.md +52 -13
- 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 +136 -55
- 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
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
projectEvents,
|
|
17
17
|
type CompatibilityState,
|
|
18
18
|
} from '../events/compatibility'
|
|
19
|
-
import type { IssueLink, NativeSessionHandle
|
|
19
|
+
import type { IssueLink, NativeSessionHandle } from '../ports/types'
|
|
20
20
|
import { advanceLanding, type LandingState } from './landing-state'
|
|
21
21
|
import { advanceIntegration, type IntegrationState } from './integration-state'
|
|
22
22
|
import { advanceNodeRestack, type NodeRestackState } from './node-restack-state'
|
|
@@ -42,6 +42,7 @@ import {
|
|
|
42
42
|
type EventPayload,
|
|
43
43
|
type PinnedAsset,
|
|
44
44
|
type ReducedWaitEndCause,
|
|
45
|
+
type VerifySkipCause,
|
|
45
46
|
type WaitRefusalCause,
|
|
46
47
|
} from '../events/payloads'
|
|
47
48
|
import type {
|
|
@@ -202,7 +203,7 @@ export interface VerifyResult {
|
|
|
202
203
|
outcome: VerifyOutcome
|
|
203
204
|
report?: ArtifactRef
|
|
204
205
|
/** Optional classification on kernel policy skips; historical skips omit it. */
|
|
205
|
-
skipCause?:
|
|
206
|
+
skipCause?: VerifySkipCause
|
|
206
207
|
/** Present exactly when `outcome === "skipped"`. */
|
|
207
208
|
reason?: string
|
|
208
209
|
/** seq of the `verify.completed` event — what `cycleSince` is compared to. */
|
|
@@ -406,7 +407,8 @@ export interface BuildState {
|
|
|
406
407
|
* clear it: the phase still needs re-running (§15.6-B/C). */
|
|
407
408
|
currentPhase?: PhaseContext
|
|
408
409
|
lastCompletedPhase?: PhaseContext
|
|
409
|
-
/** In raise order. Non-empty ≡ blocked (§15.5).
|
|
410
|
+
/** In raise order. Non-empty ≡ blocked (§15.5). The first
|
|
411
|
+
* `build.aborted` closes every entry open then, without answering it. */
|
|
410
412
|
openEscalations: OpenEscalation[]
|
|
411
413
|
/** In answer order, with resolutions for engine routing (§15.6-B). */
|
|
412
414
|
answeredEscalations: AnsweredEscalation[]
|
|
@@ -434,6 +436,8 @@ export interface BuildState {
|
|
|
434
436
|
/** seq of the first `target.rewritten` of the open episode: the run of
|
|
435
437
|
* rewrites with the same branch and rejected baseline. */
|
|
436
438
|
targetRewriteSince?: number
|
|
439
|
+
/** The open janitor failure episode. `build.janitor-recovered` and the
|
|
440
|
+
* first `build.aborted` end it. */
|
|
437
441
|
janitor?: {
|
|
438
442
|
firstFailureAt: string
|
|
439
443
|
attempt: number
|
|
@@ -500,10 +504,14 @@ export interface BuildState {
|
|
|
500
504
|
* still defined it; true until a session says otherwise. Absent for builds
|
|
501
505
|
* without a profile and historical logs. */
|
|
502
506
|
profile?: BuildProfile
|
|
503
|
-
/** Slot-admission priority
|
|
504
|
-
* `build.created`, changed by `build.priority-set`. Absent reads as
|
|
505
|
-
*
|
|
506
|
-
|
|
507
|
+
/** Slot-admission priority as its two-level fields carry it: frozen at
|
|
508
|
+
* claim by `build.created`, changed by `build.priority-set`. Absent reads as
|
|
509
|
+
* normal. Never read directly: `buildPriority` combines it with
|
|
510
|
+
* `priorityLevel`. */
|
|
511
|
+
priority?: 'urgent' | 'normal'
|
|
512
|
+
/** A high or low level (#1354), which refines `priority`; absent for
|
|
513
|
+
* urgent and normal builds and in every older log. */
|
|
514
|
+
priorityLevel?: 'high' | 'low'
|
|
507
515
|
/** Latest spec artifact rev — `spec.imported`/`spec.authored` set it,
|
|
508
516
|
* `spec.revised` bumps it (§6.3: rev N+1 restarts leaves from plan and nodes from collection). */
|
|
509
517
|
specRev?: number
|
|
@@ -682,6 +690,8 @@ export interface BuildAcc {
|
|
|
682
690
|
/** seq of the first `target.rewritten` of the open episode: the run of
|
|
683
691
|
* rewrites with the same branch and rejected baseline. */
|
|
684
692
|
targetRewriteSince?: number
|
|
693
|
+
/** The open janitor failure episode. `build.janitor-recovered` and the
|
|
694
|
+
* first `build.aborted` end it. */
|
|
685
695
|
janitor?: {
|
|
686
696
|
firstFailureAt: string
|
|
687
697
|
attempt: number
|
|
@@ -701,7 +711,8 @@ export interface BuildAcc {
|
|
|
701
711
|
issueLinks: BuildIssueLink[]
|
|
702
712
|
issueLinksSealedSeq?: number
|
|
703
713
|
profile?: BuildProfile
|
|
704
|
-
priority?:
|
|
714
|
+
priority?: 'urgent' | 'normal'
|
|
715
|
+
priorityLevel?: 'high' | 'low'
|
|
705
716
|
finalizeCompletedSeq: number
|
|
706
717
|
pipelineSettled?: number
|
|
707
718
|
slotAdmittedSeq?: number
|
|
@@ -1123,9 +1134,12 @@ function foldBuild(acc: BuildAcc, events: readonly AbEvent[]): void {
|
|
|
1123
1134
|
if (event.payload.profile !== undefined)
|
|
1124
1135
|
acc.profile = { name: event.payload.profile, configured: true }
|
|
1125
1136
|
if (event.payload.priority !== undefined) acc.priority = event.payload.priority
|
|
1137
|
+
if (event.payload.level !== undefined) acc.priorityLevel = event.payload.level
|
|
1126
1138
|
break
|
|
1127
1139
|
case 'build.priority-set':
|
|
1128
1140
|
acc.priority = event.payload.priority
|
|
1141
|
+
if (event.payload.level !== undefined) acc.priorityLevel = event.payload.level
|
|
1142
|
+
else delete acc.priorityLevel
|
|
1129
1143
|
break
|
|
1130
1144
|
case 'issue-link.downgraded': {
|
|
1131
1145
|
// One-way and only before the seal: a later, a repeated or an
|
|
@@ -1321,6 +1335,15 @@ function foldBuild(acc: BuildAcc, events: readonly AbEvent[]): void {
|
|
|
1321
1335
|
pending.resume = []
|
|
1322
1336
|
break
|
|
1323
1337
|
case 'build.aborted':
|
|
1338
|
+
// §15.5: the first `build.aborted` accepts the abort. It closes every
|
|
1339
|
+
// escalation open at that moment, janitor ones included, without an
|
|
1340
|
+
// answer, and ends the janitor failure episode, so a cleanup failure
|
|
1341
|
+
// after it escalates under a new id. A repeated abort fact, or one
|
|
1342
|
+
// after completion, closes nothing.
|
|
1343
|
+
if (terminal === undefined) {
|
|
1344
|
+
openEscalations.clear()
|
|
1345
|
+
delete acc.janitor
|
|
1346
|
+
}
|
|
1324
1347
|
terminal = 'aborted'
|
|
1325
1348
|
pending.abort = []
|
|
1326
1349
|
break
|
|
@@ -1708,6 +1731,16 @@ function foldBuild(acc: BuildAcc, events: readonly AbEvent[]): void {
|
|
|
1708
1731
|
cleanWaitResumeCompletion(event.payload, acc.lastReconcileCompletedSeq ?? 0)
|
|
1709
1732
|
)
|
|
1710
1733
|
verify.cycleSince = Math.max(verify.cycleSince, event.seq)
|
|
1734
|
+
// SPEC §16 "Clean-restack verification policy": a root-targeting
|
|
1735
|
+
// leaf's clean awaiting-landing completion that froze an opted-in
|
|
1736
|
+
// policy opens a fresh cycle on the restacked head. The engine's
|
|
1737
|
+
// `leafVerifyCycleInputs` folds the same boundary.
|
|
1738
|
+
if (
|
|
1739
|
+
event.type === 'restack.completed' &&
|
|
1740
|
+
acc.kind !== 'node' &&
|
|
1741
|
+
event.payload.cleanRestackPolicy !== undefined
|
|
1742
|
+
)
|
|
1743
|
+
verify.cycleSince = Math.max(verify.cycleSince, event.seq)
|
|
1711
1744
|
if (pr !== undefined)
|
|
1712
1745
|
pr = {
|
|
1713
1746
|
...pr,
|
|
@@ -2110,6 +2143,7 @@ function finishBuild(acc: BuildAcc): BuildState {
|
|
|
2110
2143
|
: {}),
|
|
2111
2144
|
...(acc.profile !== undefined ? { profile: { ...acc.profile } } : {}),
|
|
2112
2145
|
...(acc.priority !== undefined ? { priority: acc.priority } : {}),
|
|
2146
|
+
...(acc.priorityLevel !== undefined ? { priorityLevel: acc.priorityLevel } : {}),
|
|
2113
2147
|
specRev: acc.specRev,
|
|
2114
2148
|
restartSince: acc.restartSince,
|
|
2115
2149
|
plan: acc.plan,
|
|
@@ -46,7 +46,11 @@ export interface RepositoryAttentionState {
|
|
|
46
46
|
tickStarts: [string, number][]
|
|
47
47
|
}
|
|
48
48
|
/** Incremental journal projection. Episode starts survive run anchors and
|
|
49
|
-
* repeated evidence can strengthen, but never postpone, an existing deadline.
|
|
49
|
+
* repeated evidence can strengthen, but never postpone, an existing deadline.
|
|
50
|
+
* A tick-failure episode spans runs, so consecutive one-tick runs (hosted
|
|
51
|
+
* cron) accumulate one: any completed tick ends it, as does a clean, abnormal
|
|
52
|
+
* or forced stop of the run that last failed. A new run does not, nor does the
|
|
53
|
+
* normal stop with an error that a one-tick run records after its failed tick. */
|
|
50
54
|
export class RepositoryAttention {
|
|
51
55
|
private forge: ForgeAttention | undefined
|
|
52
56
|
private sources: Map<string, SourceAttention>
|
|
@@ -124,24 +128,29 @@ export class RepositoryAttention {
|
|
|
124
128
|
this.sources.delete(event.payload.source)
|
|
125
129
|
break
|
|
126
130
|
case 'dispatcher.run-started':
|
|
127
|
-
this.failure = undefined
|
|
128
131
|
this.tickStarts.clear()
|
|
129
132
|
break
|
|
130
133
|
case 'dispatcher.run-stopped':
|
|
131
134
|
this.tickStarts.delete(event.payload.run)
|
|
132
|
-
if (
|
|
135
|
+
if (
|
|
136
|
+
this.failure?.payload.run === event.payload.run &&
|
|
137
|
+
!(event.payload.outcome === 'normal' && event.payload.error !== undefined)
|
|
138
|
+
)
|
|
139
|
+
this.failure = undefined
|
|
133
140
|
break
|
|
134
141
|
case 'dispatcher.tick-started':
|
|
135
142
|
this.tickStarts.set(event.payload.run, Date.parse(event.payload.startedAt ?? event.ts))
|
|
136
143
|
break
|
|
137
144
|
case 'dispatcher.tick-completed':
|
|
138
145
|
this.observeRetry(event.payload.run)
|
|
139
|
-
|
|
146
|
+
this.failure = undefined
|
|
140
147
|
break
|
|
141
148
|
case 'dispatcher.tick-failed':
|
|
142
149
|
this.observeRetry(event.payload.run)
|
|
143
150
|
if (this.sourceDefersTick(Date.parse(event.ts))) this.failure = undefined
|
|
144
|
-
|
|
151
|
+
// The episode keeps its start; the observation names the latest failure.
|
|
152
|
+
else if (this.failure) this.failure = { ...this.failure, payload: event.payload }
|
|
153
|
+
else this.failure = event
|
|
145
154
|
break
|
|
146
155
|
}
|
|
147
156
|
}
|
|
@@ -88,6 +88,12 @@ export interface RepositoryReadAcc {
|
|
|
88
88
|
dispatch: ReportedDispatch
|
|
89
89
|
scanSeq?: number
|
|
90
90
|
scan?: Extract<RepositoryEvent, { type: 'dispatcher.ticket-scan-completed' }>['payload']
|
|
91
|
+
/** The latest `dispatcher.work-deferred` hint: builds the next tick sweeps
|
|
92
|
+
* first. */
|
|
93
|
+
deferredWork?: {
|
|
94
|
+
seq: number
|
|
95
|
+
builds: Extract<RepositoryEvent, { type: 'dispatcher.work-deferred' }>['payload']['builds']
|
|
96
|
+
}
|
|
91
97
|
recentRuns: [string, DispatcherRunFacts][]
|
|
92
98
|
latestRun?: string
|
|
93
99
|
latestStoppedRun?: string
|
|
@@ -246,6 +252,8 @@ export const repositoryReadFactsReducer = defineReducer({
|
|
|
246
252
|
acc.scan = event.payload
|
|
247
253
|
acc.scanSeq = event.seq
|
|
248
254
|
}
|
|
255
|
+
if (event.type === 'dispatcher.work-deferred')
|
|
256
|
+
acc.deferredWork = { seq: event.seq, builds: event.payload.builds }
|
|
249
257
|
if (event.type === 'dispatcher.run-started') acc.latestRun = event.payload.run
|
|
250
258
|
if (event.type === 'dispatcher.run-stopped') acc.latestStoppedRun = event.payload.run
|
|
251
259
|
if (
|
|
@@ -313,6 +321,7 @@ export const repositoryReadFactsReducer = defineReducer({
|
|
|
313
321
|
: undefined,
|
|
314
322
|
scan: acc.scan,
|
|
315
323
|
scanSeq: acc.scanSeq,
|
|
324
|
+
deferredWork: acc.deferredWork === undefined ? undefined : structuredClone(acc.deferredWork),
|
|
316
325
|
recentRuns: structuredClone(acc.recentRuns),
|
|
317
326
|
latestRun: acc.latestRun,
|
|
318
327
|
latestStoppedRun: acc.latestStoppedRun,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { RepositoryEvent, TicketStartOutcome, TicketStartPriority } from '../events/repository'
|
|
2
2
|
import type { TicketRef } from '../ontology'
|
|
3
|
+
import { startTierOf } from '../ports/tickets/priority'
|
|
3
4
|
import { defineReducer } from './incremental'
|
|
4
5
|
|
|
5
6
|
/** An operator's single-ticket start request the dispatcher has not settled. */
|
|
@@ -8,9 +9,13 @@ export interface PendingTicketStart {
|
|
|
8
9
|
seq: number
|
|
9
10
|
ts: string
|
|
10
11
|
ticket: TicketRef
|
|
11
|
-
/** The request's slot-admission tier; a re-request may change
|
|
12
|
+
/** The request's persisted slot-admission tier; a re-request may change
|
|
13
|
+
* it. `level` refines it (`startTierOf`). */
|
|
12
14
|
priority: TicketStartPriority
|
|
13
|
-
/**
|
|
15
|
+
/** A high or low tier (#1354), with `priority` then `normal`; omitted
|
|
16
|
+
* otherwise. Read the tier through `startTierOf`. */
|
|
17
|
+
level?: 'high' | 'low'
|
|
18
|
+
/** When a re-request last changed the tier; omitted while unchanged. */
|
|
14
19
|
prioritySetAt?: string
|
|
15
20
|
by?: string
|
|
16
21
|
}
|
|
@@ -20,6 +25,7 @@ export interface SettledTicketStart {
|
|
|
20
25
|
request: number
|
|
21
26
|
ticket: TicketRef
|
|
22
27
|
priority: TicketStartPriority
|
|
28
|
+
level?: 'high' | 'low'
|
|
23
29
|
outcome: TicketStartOutcome | 'cancelled'
|
|
24
30
|
slug?: string
|
|
25
31
|
detail?: string
|
|
@@ -50,7 +56,7 @@ export function ticketStartKey(ref: TicketRef): string {
|
|
|
50
56
|
/** Pending operator start requests, the most recent settlements, and the
|
|
51
57
|
* durable canonical identities of hosted active builds. A repeated request
|
|
52
58
|
* for a pending key keeps the first request's seq and only updates its
|
|
53
|
-
*
|
|
59
|
+
* tier when that differs, and a settle or cancel
|
|
54
60
|
* applies only to the pending request it names, so a stale one never closes
|
|
55
61
|
* a newer request. Bounded by pending requests, the recent cap, and builds
|
|
56
62
|
* not yet released. */
|
|
@@ -68,8 +74,10 @@ export const ticketStartsReducer = defineReducer<TicketStarts, RepositoryEvent,
|
|
|
68
74
|
const key = ticketStartKey(event.payload.ticket)
|
|
69
75
|
const existing = acc.pending[key]
|
|
70
76
|
if (existing !== undefined) {
|
|
71
|
-
if (existing
|
|
77
|
+
if (startTierOf(existing) !== startTierOf(event.payload)) {
|
|
72
78
|
existing.priority = event.payload.priority
|
|
79
|
+
if (event.payload.level !== undefined) existing.level = event.payload.level
|
|
80
|
+
else delete existing.level
|
|
73
81
|
existing.prioritySetAt = event.ts
|
|
74
82
|
}
|
|
75
83
|
continue
|
|
@@ -79,6 +87,7 @@ export const ticketStartsReducer = defineReducer<TicketStarts, RepositoryEvent,
|
|
|
79
87
|
ts: event.ts,
|
|
80
88
|
ticket: event.payload.ticket,
|
|
81
89
|
priority: event.payload.priority,
|
|
90
|
+
...(event.payload.level !== undefined ? { level: event.payload.level } : {}),
|
|
82
91
|
...(event.actor.kind === 'human' ? { by: event.actor.user } : {}),
|
|
83
92
|
}
|
|
84
93
|
} else if (event.type === 'ticket.start-cancelled' || event.type === 'ticket.start-settled') {
|
|
@@ -92,6 +101,7 @@ export const ticketStartsReducer = defineReducer<TicketStarts, RepositoryEvent,
|
|
|
92
101
|
request: pending.seq,
|
|
93
102
|
ticket: pending.ticket,
|
|
94
103
|
priority: pending.priority,
|
|
104
|
+
...(pending.level !== undefined ? { level: pending.level } : {}),
|
|
95
105
|
outcome: 'cancelled',
|
|
96
106
|
at: event.ts,
|
|
97
107
|
...(event.actor.kind === 'human' ? { by: event.actor.user } : {}),
|
|
@@ -100,6 +110,7 @@ export const ticketStartsReducer = defineReducer<TicketStarts, RepositoryEvent,
|
|
|
100
110
|
request: pending.seq,
|
|
101
111
|
ticket: pending.ticket,
|
|
102
112
|
priority: pending.priority,
|
|
113
|
+
...(pending.level !== undefined ? { level: pending.level } : {}),
|
|
103
114
|
outcome: event.payload.outcome,
|
|
104
115
|
...(event.payload.slug !== undefined ? { slug: event.payload.slug } : {}),
|
|
105
116
|
...(event.payload.detail !== undefined ? { detail: event.payload.detail } : {}),
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { verifyStages, type VerifyConfig } from '../config/schema'
|
|
2
|
+
import type { CleanRestackPolicy } from '../events/payloads'
|
|
2
3
|
import type { LogIndex, VerifyRecord } from './log-index'
|
|
3
4
|
import type { VerifyStageState } from './verify-stage-state'
|
|
4
5
|
import { acceptedRewriteBoundary } from './leaf-restack-base'
|
|
@@ -40,11 +41,13 @@ export function activeVerifyStage(
|
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
/** A leaf's verify cycle boundary inputs (§15.6-A): the latest code-review
|
|
43
|
-
* approval, reconcile completion, configuration boundary,
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
44
|
+
* approval, reconcile completion, configuration boundary, clean wait-resume
|
|
45
|
+
* restack after a verify:* or finalize wait (SPEC §11 "Ticket waits"), clean
|
|
46
|
+
* awaiting-landing restack that froze an opted-in clean-restack policy (SPEC
|
|
47
|
+
* §16), or an accepted rewritten target's replay boundary. Results at or
|
|
48
|
+
* before it describe an older change or base. The engine's stage selection
|
|
49
|
+
* and its `cycleBoundary` both read it; a node's wait-resume and clean-restack
|
|
50
|
+
* inputs are always 0, since nodes declare no waits and never freeze one. */
|
|
48
51
|
export function leafVerifyCycleInputs(
|
|
49
52
|
log: Pick<
|
|
50
53
|
LogIndex,
|
|
@@ -52,6 +55,7 @@ export function leafVerifyCycleInputs(
|
|
|
52
55
|
| 'lastReconcileCompletedSeq'
|
|
53
56
|
| 'verifyConfigBoundary'
|
|
54
57
|
| 'waitResumeVerifyBoundary'
|
|
58
|
+
| 'cleanRestackVerifyBoundary'
|
|
55
59
|
| 'restack'
|
|
56
60
|
>,
|
|
57
61
|
): number {
|
|
@@ -60,13 +64,14 @@ export function leafVerifyCycleInputs(
|
|
|
60
64
|
log.lastReconcileCompletedSeq,
|
|
61
65
|
log.verifyConfigBoundary,
|
|
62
66
|
log.waitResumeVerifyBoundary,
|
|
67
|
+
log.cleanRestackVerifyBoundary,
|
|
63
68
|
acceptedRewriteBoundary(log) ?? 0,
|
|
64
69
|
)
|
|
65
70
|
}
|
|
66
71
|
|
|
67
72
|
/** The restack a leaf's current verify cycle runs on, which its verify facts
|
|
68
|
-
* cite: the clean wait-resume completion that opened
|
|
69
|
-
*
|
|
73
|
+
* cite: the clean wait-resume or clean-restack-policy completion that opened
|
|
74
|
+
* the cycle (whichever is newer), else the replay boundary's verify-entry or
|
|
70
75
|
* reconcile-linked completion. Undefined before any restack completed. */
|
|
71
76
|
export function leafVerifiedRestack(
|
|
72
77
|
log: Pick<
|
|
@@ -75,6 +80,8 @@ export function leafVerifiedRestack(
|
|
|
75
80
|
| 'lastReconcileCompletedSeq'
|
|
76
81
|
| 'waitResumeVerifyBoundary'
|
|
77
82
|
| 'waitResumeVerifyCycle'
|
|
83
|
+
| 'cleanRestackVerifyBoundary'
|
|
84
|
+
| 'cleanRestackVerifyCycle'
|
|
78
85
|
| 'restack'
|
|
79
86
|
>,
|
|
80
87
|
) {
|
|
@@ -83,7 +90,39 @@ export function leafVerifiedRestack(
|
|
|
83
90
|
log.lastReconcileCompletedSeq,
|
|
84
91
|
acceptedRewriteBoundary(log) ?? 0,
|
|
85
92
|
)
|
|
93
|
+
if (
|
|
94
|
+
log.cleanRestackVerifyBoundary > replay &&
|
|
95
|
+
log.cleanRestackVerifyBoundary > log.waitResumeVerifyBoundary
|
|
96
|
+
)
|
|
97
|
+
return log.restack.gates[String(log.cleanRestackVerifyCycle)]
|
|
86
98
|
return log.waitResumeVerifyBoundary > replay
|
|
87
99
|
? log.restack.gates[String(log.waitResumeVerifyCycle)]
|
|
88
100
|
: log.restack.gates[String(replay)]
|
|
89
101
|
}
|
|
102
|
+
|
|
103
|
+
/** The frozen clean-restack policy governing the current verify cycle: only
|
|
104
|
+
* while its completion is newer than every other code boundary (approval,
|
|
105
|
+
* reconcile, accepted rewrite, wait resume). A later boundary restores
|
|
106
|
+
* ordinary verification. */
|
|
107
|
+
export function cleanRestackPolicyInForce(
|
|
108
|
+
log: Pick<
|
|
109
|
+
LogIndex,
|
|
110
|
+
| 'code'
|
|
111
|
+
| 'lastReconcileCompletedSeq'
|
|
112
|
+
| 'waitResumeVerifyBoundary'
|
|
113
|
+
| 'cleanRestackVerifyBoundary'
|
|
114
|
+
| 'cleanRestackPolicy'
|
|
115
|
+
| 'restack'
|
|
116
|
+
>,
|
|
117
|
+
): CleanRestackPolicy | undefined {
|
|
118
|
+
if (log.cleanRestackPolicy === undefined) return undefined
|
|
119
|
+
return log.cleanRestackVerifyBoundary >
|
|
120
|
+
Math.max(
|
|
121
|
+
log.code.latestApproveSeq,
|
|
122
|
+
log.lastReconcileCompletedSeq,
|
|
123
|
+
acceptedRewriteBoundary(log) ?? 0,
|
|
124
|
+
log.waitResumeVerifyBoundary,
|
|
125
|
+
)
|
|
126
|
+
? log.cleanRestackPolicy
|
|
127
|
+
: undefined
|
|
128
|
+
}
|
|
@@ -12,8 +12,9 @@
|
|
|
12
12
|
*
|
|
13
13
|
* Read cost per call is bounded: one `repository.status` pass, one open-build
|
|
14
14
|
* view pass (one facts read per open, nonterminal build; settled builds are
|
|
15
|
-
* never listed),
|
|
16
|
-
*
|
|
15
|
+
* never listed), one `doneEscalations` rollup read with a record and facts
|
|
16
|
+
* read per done build that still has an open escalation, and one repository
|
|
17
|
+
* journal page of at most 256 rows after the cursor. Nothing grows with log length or settled history, and the call
|
|
17
18
|
* reads zero event rows when nothing changed since the cursor.
|
|
18
19
|
*/
|
|
19
20
|
import { isDiverged } from '../cli/build-progress'
|
|
@@ -27,6 +28,7 @@ import type { TicketRef } from '../ontology'
|
|
|
27
28
|
import type { BuildStore } from '../store/types'
|
|
28
29
|
import type { OperatorToolName } from './annotations'
|
|
29
30
|
import { consentEntryFromView } from './landings'
|
|
31
|
+
import { doneEscalatedBuilds } from './done-escalations'
|
|
30
32
|
import { getRepositoryStatus } from './query'
|
|
31
33
|
import { withOperatorView } from './read-view'
|
|
32
34
|
import { readRepositoryAttentionPage } from './repository-events'
|
|
@@ -382,7 +384,8 @@ export async function getOperatorAttention(opts: {
|
|
|
382
384
|
const escalations: AttentionEscalationItem[] = []
|
|
383
385
|
const merges: AttentionMergeItem[] = []
|
|
384
386
|
const waiting: AttentionWaitingItem[] = []
|
|
385
|
-
|
|
387
|
+
const open = await view.listOpenBuilds(repo)
|
|
388
|
+
for (const { record, digest } of open) {
|
|
386
389
|
if (record.repo !== repo || digest.terminal !== undefined) continue
|
|
387
390
|
const facts = await view.buildFacts(record.slug)
|
|
388
391
|
const state = facts.state
|
|
@@ -440,6 +443,28 @@ export async function getOperatorAttention(opts: {
|
|
|
440
443
|
}),
|
|
441
444
|
)
|
|
442
445
|
}
|
|
446
|
+
// A done build's escalation waits on an acknowledgement only: no merge
|
|
447
|
+
// or waiting item, and the build stays done.
|
|
448
|
+
const openSlugs = new Set(open.map(({ record }) => record.slug))
|
|
449
|
+
for (const { record, facts } of await doneEscalatedBuilds(view, repo, openSlugs)) {
|
|
450
|
+
const summary = summarizeFrom(record, facts.state, now)
|
|
451
|
+
escalations.push({
|
|
452
|
+
slug: record.slug,
|
|
453
|
+
...(record.ticket !== undefined ? { ticket: record.ticket } : {}),
|
|
454
|
+
status: summary.status,
|
|
455
|
+
...(summary.phase !== undefined ? { phase: summary.phase } : {}),
|
|
456
|
+
...(summary.round !== undefined ? { round: summary.round } : {}),
|
|
457
|
+
escalations: facts.state.openEscalations,
|
|
458
|
+
resolve: [
|
|
459
|
+
{
|
|
460
|
+
tool: 'builds.answer',
|
|
461
|
+
input: { repo, slug: record.slug },
|
|
462
|
+
by: 'operator',
|
|
463
|
+
note: 'acknowledges; the build stays done',
|
|
464
|
+
},
|
|
465
|
+
],
|
|
466
|
+
})
|
|
467
|
+
}
|
|
443
468
|
return {
|
|
444
469
|
escalations: escalations.sort(bySlug),
|
|
445
470
|
merges: merges.sort(bySlug),
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `done` builds with an open escalation that operator surfaces list
|
|
3
|
+
* beside the open builds (SPEC §7.7 `doneEscalations`, §14).
|
|
4
|
+
*
|
|
5
|
+
* One `doneEscalations` rollup read, then `getBuild` and the saved build facts
|
|
6
|
+
* per listed build: bounded by escalated done builds, never by history. Each
|
|
7
|
+
* candidate is confirmed against its reduced state, so the row and attention
|
|
8
|
+
* text always come from the build reducer. Call it inside an existing
|
|
9
|
+
* operator view pass; it opens none of its own.
|
|
10
|
+
*/
|
|
11
|
+
import { openOnDone } from '../kernel/done-escalations'
|
|
12
|
+
import type { RepoViewStore } from '../processes/repo-view'
|
|
13
|
+
import { readDoneEscalations, type CurrentBuildFacts } from '../store/reduced-reads'
|
|
14
|
+
import type { BuildRecord } from '../store/types'
|
|
15
|
+
|
|
16
|
+
export interface DoneEscalatedBuild {
|
|
17
|
+
record: BuildRecord
|
|
18
|
+
facts: CurrentBuildFacts
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** Escalated done builds of `repo`, by slug, skipping `skip` (builds the
|
|
22
|
+
* caller already read as open). */
|
|
23
|
+
export async function doneEscalatedBuilds(
|
|
24
|
+
view: RepoViewStore,
|
|
25
|
+
repo: string,
|
|
26
|
+
skip: ReadonlySet<string> = new Set(),
|
|
27
|
+
): Promise<DoneEscalatedBuild[]> {
|
|
28
|
+
const listed = await readDoneEscalations(view, repo)
|
|
29
|
+
const builds: DoneEscalatedBuild[] = []
|
|
30
|
+
for (const { slug } of listed.builds) {
|
|
31
|
+
if (skip.has(slug)) continue
|
|
32
|
+
const record = await view.getBuild(slug)
|
|
33
|
+
if (record === null || record.repo !== repo) continue
|
|
34
|
+
const facts = await view.buildFacts(slug)
|
|
35
|
+
if (openOnDone(facts.state)) builds.push({ record, facts })
|
|
36
|
+
}
|
|
37
|
+
return builds
|
|
38
|
+
}
|
|
@@ -52,5 +52,5 @@ export type { DashboardHandoff } from '../cli/dashboard/handoff'
|
|
|
52
52
|
export { formatRollback } from '../cli/dashboard/rollback'
|
|
53
53
|
export type { DashboardRollback } from '../cli/dashboard/rollback'
|
|
54
54
|
export { handPushedLabel, handPushedText } from '../cli/dashboard/hand-pushed'
|
|
55
|
-
export { URGENT_MARK, queuedTickets } from '../cli/dashboard/queue'
|
|
55
|
+
export { PRIORITY_MARKS, URGENT_MARK, queuedTickets } from '../cli/dashboard/queue'
|
|
56
56
|
export type { QueuedTicket } from '../cli/dashboard/queue'
|
|
@@ -2,9 +2,12 @@ import { z } from 'zod'
|
|
|
2
2
|
import { abortDestinationSchema } from '../events/payloads'
|
|
3
3
|
import { issueLinksInputSchema } from '../ports/tickets/issue-links'
|
|
4
4
|
import { TICKET_MOVE_ROLES } from '../ports/tickets/lifecycle'
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
buildPrioritySchema,
|
|
7
|
+
startTierSchema,
|
|
8
|
+
ticketPrioritySchema,
|
|
9
|
+
} from '../ports/tickets/priority'
|
|
6
10
|
import { ticketAssigneesSchema } from '../ports/tickets/assignees'
|
|
7
|
-
import { ticketStartPrioritySchema } from '../events/repository'
|
|
8
11
|
|
|
9
12
|
const issueLinksField = issueLinksInputSchema
|
|
10
13
|
.optional()
|
|
@@ -15,7 +18,7 @@ const issueLinksField = issueLinksInputSchema
|
|
|
15
18
|
const priorityField = ticketPrioritySchema
|
|
16
19
|
.optional()
|
|
17
20
|
.describe(
|
|
18
|
-
'
|
|
21
|
+
'Priority level: "urgent", "high", "normal" (the default) or "low". Dispatch claims ready work by level, urgent, then high, normal and low, each in the source\'s order, never preempting a running build; only urgent claims bypass open-PR backpressure. On update, "normal" clears the level. A source without native priority stores it as a priority:<level> label.',
|
|
19
22
|
)
|
|
20
23
|
|
|
21
24
|
const assigneesField = ticketAssigneesSchema
|
|
@@ -47,7 +50,7 @@ export const buildControlRequestSchema = z.discriminatedUnion('action', [
|
|
|
47
50
|
}),
|
|
48
51
|
z.strictObject({ action: z.literal('hold'), reason: z.string().optional() }),
|
|
49
52
|
/** Slot-admission priority for an active build; never changes the ticket. */
|
|
50
|
-
z.strictObject({ action: z.literal('priority'), priority:
|
|
53
|
+
z.strictObject({ action: z.literal('priority'), priority: buildPrioritySchema }),
|
|
51
54
|
])
|
|
52
55
|
export type OperatorBuildControlRequest = z.infer<typeof buildControlRequestSchema>
|
|
53
56
|
|
|
@@ -177,7 +180,7 @@ export const ticketMoveRequestSchema = ticketMoveRequestShape.refine(
|
|
|
177
180
|
)
|
|
178
181
|
/** `POST …/tickets/{id}/start`'s optional body; an empty body is manual. */
|
|
179
182
|
export const ticketStartRequestSchema = z.strictObject({
|
|
180
|
-
priority:
|
|
183
|
+
priority: startTierSchema.optional(),
|
|
181
184
|
})
|
|
182
185
|
export const ticketBlockerRequestSchema = z.strictObject({
|
|
183
186
|
expectedRevision: expectedRevisionSchema,
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { normalizeEffectiveConfigArtifact } from '../config/effective-artifact'
|
|
2
2
|
import { enrichDrainingRow, projectHandoffs } from '../cli/dashboard/handoff'
|
|
3
3
|
import { repositoryQueueDepth } from '../cli/dashboard/header'
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
enrichIntegrationRows,
|
|
6
|
+
unresolvedIntegrationRecords,
|
|
7
|
+
} from '../cli/dashboard/integration-row'
|
|
5
8
|
import {
|
|
6
9
|
dispatchCapacity,
|
|
7
10
|
startClaimDemand,
|
|
8
|
-
|
|
11
|
+
claimDemand,
|
|
9
12
|
type CapacityBuild,
|
|
10
13
|
} from '../kernel/dispatch-capacity'
|
|
11
14
|
import { landingRestackDue } from '../kernel/engine'
|
|
@@ -59,6 +62,7 @@ import { DISPATCHER_EFFECTIVE_CONFIG_ARTIFACT } from '../store/retention'
|
|
|
59
62
|
import { reduceDispatchStatus } from '../kernel/dispatch-status'
|
|
60
63
|
import type { RepoViewStore } from '../processes/repo-view'
|
|
61
64
|
import { withOperatorView } from './read-view'
|
|
65
|
+
import { doneEscalatedBuilds } from './done-escalations'
|
|
62
66
|
import type { RepositoryEvent } from '../events/repository'
|
|
63
67
|
import type { BuildRecord, BuildStore, Clock } from '../store/types'
|
|
64
68
|
|
|
@@ -284,12 +288,14 @@ async function readPinnedConfig(
|
|
|
284
288
|
* AUT-487 digest): `effectiveStatus` maps only `done` outside the visible set
|
|
285
289
|
* (cli/dashboard/model.ts `isVisible`), so `projectBuild` returns null
|
|
286
290
|
* exactly for this state, and a pinned effective-config read for such a
|
|
287
|
-
* build could never be surfaced.
|
|
288
|
-
*
|
|
289
|
-
*
|
|
290
|
-
*
|
|
291
|
-
*
|
|
292
|
-
*
|
|
291
|
+
* build could never be surfaced. A `done` build with an open escalation
|
|
292
|
+
* projects as `blocked`, so it passes this gate and renders a row. One
|
|
293
|
+
* predicate so every consumer cannot diverge from each other or from the row
|
|
294
|
+
* projection: the digest's `terminal` is a third consumer of the same gate —
|
|
295
|
+
* the open listing holds no completed build, and the snapshot reads escalated
|
|
296
|
+
* done builds through the `doneEscalations` rollup instead — so the snapshot
|
|
297
|
+
* skips a finished build's history and pinned-config reads without weakening
|
|
298
|
+
* this predicate as the authority. If cli/dashboard/model.ts ever adds a
|
|
293
299
|
* non-visible status, this predicate must follow — the snapshot
|
|
294
300
|
* byte-identical differential test and the done/aborted query tests pin the
|
|
295
301
|
* coupling. */
|
|
@@ -459,6 +465,21 @@ async function dashboardFromView(
|
|
|
459
465
|
)
|
|
460
466
|
if (row !== null) projected.push(decorateWithPinnedMeta(row, pinned))
|
|
461
467
|
}
|
|
468
|
+
// A done build with an open escalation renders a row until it is
|
|
469
|
+
// acknowledged, through the `doneEscalations` rollup; it holds no slot.
|
|
470
|
+
const openSlugs = new Set(open.map(({ record }) => record.slug))
|
|
471
|
+
for (const { record, facts } of await doneEscalatedBuilds(view, opts.repo, openSlugs)) {
|
|
472
|
+
const pinned = await readPinnedConfig(view, record.slug, config, facts.state.verify.configPin)
|
|
473
|
+
const row = projectBuildFromFacts(
|
|
474
|
+
record,
|
|
475
|
+
facts.state,
|
|
476
|
+
{ dashboard: facts.dashboard, log: facts.log, deferral: facts.deferral },
|
|
477
|
+
config,
|
|
478
|
+
undefined,
|
|
479
|
+
pinned.config,
|
|
480
|
+
)
|
|
481
|
+
if (row !== null) projected.push(decorateWithPinnedMeta(row, pinned))
|
|
482
|
+
}
|
|
462
483
|
// The pure core writes nothing — a snapshot performs no store writes and
|
|
463
484
|
// never creates or locks the repository record.
|
|
464
485
|
const warningLines = [
|
|
@@ -467,7 +488,7 @@ async function dashboardFromView(
|
|
|
467
488
|
...(status.warningNotice !== undefined ? [status.warningNotice] : []),
|
|
468
489
|
]
|
|
469
490
|
const capacityProjection = dispatchCapacity(capacityBuilds, config.capacity, opts.clock(), {
|
|
470
|
-
|
|
491
|
+
claims: claimDemand(repositoryEvents),
|
|
471
492
|
openPrs: {
|
|
472
493
|
policy: config.policy,
|
|
473
494
|
engaged: repositoryEvents.openPrBackpressure !== undefined,
|
|
@@ -503,16 +524,9 @@ async function integrationRecords(
|
|
|
503
524
|
rows: readonly DashboardBuild[],
|
|
504
525
|
open: readonly BuildRecord[],
|
|
505
526
|
): Promise<BuildRecord[]> {
|
|
506
|
-
const
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
for (const child of row.integrationDetail?.children ?? []) {
|
|
510
|
-
if (!child.builds?.length) continue
|
|
511
|
-
if (!child.builds.includes(child.id) && child.title !== 'title unavailable') continue
|
|
512
|
-
for (const slug of child.builds) if (!listed.has(slug)) wanted.add(slug)
|
|
513
|
-
}
|
|
514
|
-
if (wanted.size === 0) return [...open]
|
|
515
|
-
const settled = await Promise.all([...wanted].map((slug) => view.getBuild(slug)))
|
|
527
|
+
const wanted = unresolvedIntegrationRecords(rows, new Set(open.map((record) => record.slug)))
|
|
528
|
+
if (wanted.length === 0) return [...open]
|
|
529
|
+
const settled = await Promise.all(wanted.map((slug) => view.getBuild(slug)))
|
|
516
530
|
return [
|
|
517
531
|
...open,
|
|
518
532
|
...settled.filter((record): record is BuildRecord => record !== null && record.repo === repo),
|