@defrex/autobuild 1.0.1 → 1.1.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 +6 -6
- package/SPEC.md +360 -229
- package/docs/answering-blocked-builds.md +2 -2
- package/docs/architecture.md +155 -45
- package/docs/assets/headline-wide.png +0 -0
- package/docs/builds.md +4 -4
- package/docs/cli.md +4 -4
- package/docs/configuration-overview.md +4 -4
- package/docs/configuration.md +245 -210
- package/docs/dispatcher-hosting.md +2 -2
- package/docs/dispatcher.md +1 -1
- package/docs/forges.md +5 -5
- package/docs/getting-started.md +2 -2
- package/docs/glossary.md +6 -6
- package/docs/hosted-dispatcher.md +6 -3
- package/docs/hosted-service.md +16 -5
- package/docs/integration-overview.md +15 -15
- package/docs/integration-tree.md +45 -38
- package/docs/integration.md +6 -6
- package/docs/mcp.md +16 -15
- package/docs/{landing-policy.md → merge-policy.md} +42 -24
- package/docs/migration-1.0.md +17 -13
- package/docs/operating.md +41 -18
- package/docs/operator-api.md +91 -15
- package/docs/operator-surfaces.md +8 -4
- package/docs/overview.md +3 -3
- package/docs/remote-store-protocol.md +76 -11
- package/docs/remote-ticket-protocol.md +1 -1
- package/docs/restacking.md +54 -15
- package/docs/setup.md +41 -6
- package/docs/skills.md +1 -1
- package/docs/spec-standard.md +6 -6
- package/docs/ticket-dependencies.md +7 -7
- package/docs/tickets.md +8 -2
- package/docs/troubleshooting.md +2 -2
- package/docs/upgrading.md +8 -3
- package/docs/verification.md +60 -14
- package/package.json +7 -5
- package/packages/core/src/cli/binary-direct.ts +13 -1
- package/packages/core/src/cli/binary-lifecycle.ts +65 -2
- package/packages/core/src/cli/build-control.ts +83 -28
- package/packages/core/src/cli/context.ts +81 -38
- package/packages/core/src/cli/dashboard/facts.ts +2 -1
- package/packages/core/src/cli/dashboard/integration-detail.ts +8 -8
- package/packages/core/src/cli/dashboard/integration-row.ts +40 -13
- package/packages/core/src/cli/dashboard/landing-display.ts +25 -0
- package/packages/core/src/cli/dashboard/model.ts +56 -33
- package/packages/core/src/cli/dashboard/poll.ts +9 -3
- package/packages/core/src/cli/dashboard/render.ts +59 -37
- package/packages/core/src/cli/dashboard/target-distance.ts +14 -0
- package/packages/core/src/cli/dashboard/tree.ts +3 -2
- package/packages/core/src/cli/dispatch-args.ts +1 -1
- package/packages/core/src/cli/dispatch-frontend.ts +6 -3
- package/packages/core/src/cli/dispatch.ts +35 -9
- package/packages/core/src/cli/env.ts +4 -0
- package/packages/core/src/cli/help.ts +30 -23
- package/packages/core/src/cli/main.ts +24 -8
- package/packages/core/src/cli/node-verification-provenance.ts +1 -97
- package/packages/core/src/cli/publication-settlement.ts +43 -20
- package/packages/core/src/cli/repository-status.ts +20 -9
- package/packages/core/src/cli/status.ts +42 -5
- package/packages/core/src/cli/store-opening.ts +6 -1
- package/packages/core/src/cli/terminal.ts +22 -1
- package/packages/core/src/cli/terminals.ts +14 -10
- package/packages/core/src/cli/upgrade-landing.ts +70 -30
- package/packages/core/src/cli/upgrade.ts +3 -1
- package/packages/core/src/cli/wait.ts +15 -7
- package/packages/core/src/cli/watch-lifetime.ts +111 -0
- package/packages/core/src/cli/watch.ts +634 -511
- package/packages/core/src/config/effective-artifact.fixture.ts +27 -0
- package/packages/core/src/config/effective-artifact.ts +13 -0
- package/packages/core/src/config/landing.ts +1 -1
- package/packages/core/src/config/load.ts +21 -1
- package/packages/core/src/config/pipeline-source.ts +28 -0
- package/packages/core/src/config/reference-metadata.ts +2 -0
- package/packages/core/src/config/reference.ts +22 -7
- package/packages/core/src/config/schema.ts +86 -162
- package/packages/core/src/context-directory.ts +26 -0
- package/packages/core/src/distribution-packaging.ts +26 -5
- package/packages/core/src/events/catalog.ts +10 -2
- package/packages/core/src/events/globs.ts +1 -1
- package/packages/core/src/events/payloads.ts +70 -1
- package/packages/core/src/events/policy.ts +7 -0
- package/packages/core/src/events/repository.ts +2 -4
- package/packages/core/src/events/sessions.ts +6 -6
- package/packages/core/src/kernel/__snapshots__/reducer-accumulator-shapes.json +571 -0
- package/packages/core/src/kernel/auto-merge.ts +2 -2
- package/packages/core/src/kernel/engine.ts +255 -26
- package/packages/core/src/kernel/generators/leaf-restack-log.ts +10 -0
- package/packages/core/src/kernel/integration-landing.ts +3 -3
- package/packages/core/src/kernel/integration-state.ts +27 -4
- package/packages/core/src/kernel/leaf-restack-state.ts +28 -3
- package/packages/core/src/kernel/log-index.ts +13 -1
- package/packages/core/src/kernel/node-landing.ts +8 -8
- package/packages/core/src/kernel/node-parent.ts +2 -2
- package/packages/core/src/kernel/node-restack-transaction.ts +1 -1
- package/packages/core/src/kernel/node-verification-context.ts +216 -0
- package/packages/core/src/kernel/phases.ts +1 -1
- package/packages/core/src/kernel/plan-verify-selection.ts +16 -0
- package/packages/core/src/kernel/publication-retry.ts +168 -0
- package/packages/core/src/kernel/reconcile-restack.ts +29 -1
- package/packages/core/src/kernel/reducer.ts +82 -5
- package/packages/core/src/kernel/target-distance.ts +45 -0
- package/packages/core/src/kernel/terminal-guard.ts +10 -1
- package/packages/core/src/kernel/verify-stage-state.ts +123 -0
- package/packages/core/src/kernel/verify-stages.ts +39 -0
- package/packages/core/src/ontology.ts +1 -0
- package/packages/core/src/operator/annotations.ts +6 -0
- package/packages/core/src/operator/control.ts +1 -1
- package/packages/core/src/operator/index.ts +1 -7
- package/packages/core/src/operator/landings.ts +5 -1
- package/packages/core/src/operator/presentation.ts +6 -1
- package/packages/core/src/operator/query.ts +14 -18
- package/packages/core/src/operator/registry.ts +17 -6
- package/packages/core/src/operator/sandbox-host.ts +64 -40
- package/packages/core/src/operator/sandbox.ts +3 -0
- package/packages/core/src/operator/ticket-source-backend.ts +3 -12
- package/packages/core/src/ports/forge/contract.ts +2 -2
- package/packages/core/src/ports/forge/git-rewrite.ts +25 -2
- package/packages/core/src/ports/forge/github-readiness.ts +2 -2
- package/packages/core/src/ports/forge/github.ts +26 -7
- package/packages/core/src/ports/forge/local-git.ts +4 -4
- package/packages/core/src/ports/forge/readiness.ts +1 -1
- package/packages/core/src/ports/forge-failure.ts +24 -0
- package/packages/core/src/ports/workspace/build-execution.ts +3 -1
- package/packages/core/src/ports/workspace/phase-scratch.ts +4 -3
- package/packages/core/src/ports/workspace/vercel-sandbox.ts +59 -39
- package/packages/core/src/processes/build-child.ts +6 -8
- package/packages/core/src/processes/build-execution-state.ts +8 -5
- package/packages/core/src/processes/build-runner.ts +522 -98
- package/packages/core/src/processes/dispatcher.ts +186 -101
- package/packages/core/src/processes/execution-no-progress.ts +8 -1
- package/packages/core/src/processes/phase-failure-budget.ts +1 -0
- package/packages/core/src/processes/publication-loss.ts +8 -2
- package/packages/core/src/processes/publication-state.ts +42 -4
- package/packages/core/src/processes/repo-view.ts +14 -0
- package/packages/core/src/processes/verify-cycle-config.ts +96 -0
- package/packages/core/src/{integration → scenarios}/harness.ts +330 -317
- package/packages/core/src/store/adapter.ts +1 -0
- package/packages/core/src/store/build-scope.ts +9 -0
- package/packages/core/src/store/contract.ts +113 -1
- package/packages/core/src/store/local/schema.ts +13 -0
- package/packages/core/src/store/local/store.ts +42 -0
- package/packages/core/src/store/memory.ts +47 -0
- package/packages/core/src/store/operator-presence.ts +21 -0
- package/packages/core/src/store/phase-session.ts +10 -0
- package/packages/core/src/store/reducer-value-shapes.json +5081 -4160
- package/packages/core/src/store/remote/client.ts +47 -1
- package/packages/core/src/store/remote/compatibility.ts +2 -0
- package/packages/core/src/store/remote/protocol.ts +4 -0
- package/packages/core/src/store/remote/version.ts +3 -1
- package/packages/core/src/store/retention.ts +2 -3
- package/packages/core/src/store/session-handle.ts +9 -0
- package/packages/core/src/store/streams/session-writer.ts +1 -1
- package/packages/core/src/store/types.ts +12 -2
- package/packages/core/src/testing/index.ts +11 -1
- package/packages/core/src/testing/temp-directories.ts +58 -0
- package/skills/code-review/SKILL.md +23 -9
- package/skills/finalize/SKILL.md +15 -7
- package/skills/guide/SKILL.md +253 -118
- package/skills/guide/references/integration-tree.md +45 -38
- package/skills/guide/references/{landing-policy.md → merge-policy.md} +42 -24
- package/skills/guide/references/migration-1.0.md +17 -13
- package/skills/guide/references/operator-api.md +91 -15
- package/skills/guide/references/remote-store-protocol.md +76 -11
- package/skills/guide/references/remote-ticket-protocol.md +1 -1
- package/skills/guide/references/restacking.md +54 -15
- package/skills/guide/references/setup.md +41 -6
- package/skills/guide/references/spec-standard.md +6 -6
- package/skills/guide/references/ticket-dependencies.md +7 -7
- package/skills/implement/SKILL.md +43 -17
- package/skills/operate/SKILL.md +117 -116
- package/skills/plan/SKILL.md +39 -13
- package/skills/plan-review/SKILL.md +15 -10
- package/skills/reconcile/SKILL.md +22 -3
- package/skills/spec/SKILL.md +19 -19
- package/skills/tickets/SKILL.md +9 -7
- package/templates/autobuild.toml +1 -1
- package/templates/hosted-service/package.json +2 -2
- package/packages/core/src/orchestrator/approvals.ts +0 -115
- package/packages/core/src/orchestrator/conversation.ts +0 -167
- package/packages/core/src/orchestrator/model.ts +0 -86
- package/packages/core/src/orchestrator/prompt.ts +0 -63
- package/packages/core/src/orchestrator/tools.ts +0 -117
- package/packages/core/src/orchestrator/turn-runner.ts +0 -457
- package/packages/core/src/processes/orchestrator-tick.ts +0 -360
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
integrationCycleVerified,
|
|
10
10
|
} from '../../kernel/integration-state'
|
|
11
11
|
import { landingReady } from '../../kernel/landing-readiness'
|
|
12
|
-
import { projectIntegrationRow } from './integration-row'
|
|
12
|
+
import { projectIntegrationRow, integrationRepairSteps } from './integration-row'
|
|
13
13
|
import { nodeLandingPolicyDisplay, nodeLandingRuleDisplay } from './landing-display'
|
|
14
14
|
|
|
15
15
|
export interface IntegrationChild {
|
|
@@ -65,7 +65,7 @@ export function projectIntegrationDetail(
|
|
|
65
65
|
state:
|
|
66
66
|
c.builds?.some((b) => contributions.has(b)) &&
|
|
67
67
|
!(c.source === membershipSource && open.has(c.id))
|
|
68
|
-
? '
|
|
68
|
+
? 'merged'
|
|
69
69
|
: 'queued',
|
|
70
70
|
}))
|
|
71
71
|
for (const id of open)
|
|
@@ -84,7 +84,7 @@ export function projectIntegrationDetail(
|
|
|
84
84
|
id: contribution,
|
|
85
85
|
builds: [contribution],
|
|
86
86
|
title: 'title unavailable',
|
|
87
|
-
state: '
|
|
87
|
+
state: 'merged',
|
|
88
88
|
landed: true,
|
|
89
89
|
})
|
|
90
90
|
children.sort(
|
|
@@ -113,7 +113,7 @@ export function projectIntegrationDetail(
|
|
|
113
113
|
results.findLast((r) => r.step === step)?.outcome ??
|
|
114
114
|
'pending',
|
|
115
115
|
}))
|
|
116
|
-
const failed =
|
|
116
|
+
const failed = integrationRepairSteps(state)
|
|
117
117
|
const conflict =
|
|
118
118
|
state.nodeRestack?.conflict ??
|
|
119
119
|
(restack.active && restack.replay?.conflicted ? restack.replay : undefined)
|
|
@@ -134,14 +134,14 @@ export function projectIntegrationDetail(
|
|
|
134
134
|
children,
|
|
135
135
|
membershipKnown: !!observation && !observation.diagnostics.length,
|
|
136
136
|
diagnostics: observation?.diagnostics ?? ['child membership unknown'],
|
|
137
|
-
verification: failed
|
|
138
|
-
? `${failed.
|
|
137
|
+
verification: failed.length
|
|
138
|
+
? `${failed.join(', ')} failed — file a repair child targeting ${record.ticket?.id ?? record.slug}`
|
|
139
139
|
: !integrationComplete(state)
|
|
140
|
-
? `pending — runs on the node head against ${row.destination} once every child has
|
|
140
|
+
? `pending — runs on the node head against ${row.destination} once every child has merged`
|
|
141
141
|
: current && integrationCycleVerified(state)
|
|
142
142
|
? 'verified on the current node head and destination'
|
|
143
143
|
: 'pending on the current node head and destination',
|
|
144
144
|
verifySteps,
|
|
145
|
-
landing: `${mode} — ${nodeLandingRuleDisplay(state, config.landing)}${landingReady(state, restack) && mode === 'consent' && state.landing?.command?.kind !== 'land' ? ` — press l, or ab
|
|
145
|
+
landing: `${mode} — ${nodeLandingRuleDisplay(state, config.landing)}${landingReady(state, restack) && mode === 'consent' && state.landing?.command?.kind !== 'land' ? ` — press l, or ab merge ${record.slug}` : ''}`,
|
|
146
146
|
}
|
|
147
147
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { distanceSuffix } from './target-distance'
|
|
1
2
|
import type { Config } from '../../config/schema'
|
|
2
3
|
import type { BuildState } from '../../kernel/reducer'
|
|
3
4
|
import type { LeafRestackState } from '../../kernel/leaf-restack-state'
|
|
@@ -11,6 +12,32 @@ import type { BuildRecord } from '../../store/types'
|
|
|
11
12
|
import type { DashboardBuild, PipelineStep } from './model'
|
|
12
13
|
import { nodeLandingPolicyDisplay } from './landing-display'
|
|
13
14
|
|
|
15
|
+
/** Repair prompts share the engine's settled-stage barrier and exact cycle evidence. */
|
|
16
|
+
export function integrationRepairSteps(state: BuildState): string[] {
|
|
17
|
+
const cycle = state.integration?.cycle
|
|
18
|
+
if (!cycle || !integrationCurrent(state)) return []
|
|
19
|
+
const pinned = JSON.parse(cycle.config).verify
|
|
20
|
+
if (Array.isArray(pinned.stages)) {
|
|
21
|
+
const receipt = state.verifyStage.failures.find(
|
|
22
|
+
(failure) =>
|
|
23
|
+
failure.cycle === cycle.seq &&
|
|
24
|
+
failure.restackId === cycle.id &&
|
|
25
|
+
failure.headSha === cycle.head &&
|
|
26
|
+
failure.baseSha === cycle.parent,
|
|
27
|
+
)
|
|
28
|
+
return receipt?.failed.map((failure) => failure.step) ?? []
|
|
29
|
+
}
|
|
30
|
+
const first = state.verify.results.find(
|
|
31
|
+
(result) =>
|
|
32
|
+
result.seq > cycle.seq &&
|
|
33
|
+
result.restackId === cycle.id &&
|
|
34
|
+
result.headSha === cycle.head &&
|
|
35
|
+
result.baseSha === cycle.parent &&
|
|
36
|
+
result.outcome === 'fail',
|
|
37
|
+
)
|
|
38
|
+
return first ? [first.step] : []
|
|
39
|
+
}
|
|
40
|
+
|
|
14
41
|
/** Shared list progress and five integration steps. */
|
|
15
42
|
export interface IntegrationRow {
|
|
16
43
|
parentDistance?: string
|
|
@@ -32,7 +59,7 @@ export function projectIntegrationRow(
|
|
|
32
59
|
): IntegrationRow | undefined {
|
|
33
60
|
if (state.kind !== 'node') return undefined
|
|
34
61
|
const destination = state.target
|
|
35
|
-
?
|
|
62
|
+
? state.target.ticket.id
|
|
36
63
|
: (state.baseBranch ?? 'unknown destination')
|
|
37
64
|
const observation = state.integration?.observation
|
|
38
65
|
const openChildren = [...new Set(observation?.openChildren ?? [])]
|
|
@@ -55,7 +82,7 @@ export function projectIntegrationRow(
|
|
|
55
82
|
expected.includes(r.step),
|
|
56
83
|
)
|
|
57
84
|
: []
|
|
58
|
-
const
|
|
85
|
+
const failed = integrationRepairSteps(state)
|
|
59
86
|
const passed = new Set(
|
|
60
87
|
receipts.filter((r) => r.outcome === 'pass' || r.outcome === 'skipped').map((r) => r.step),
|
|
61
88
|
).size
|
|
@@ -79,15 +106,15 @@ export function projectIntegrationRow(
|
|
|
79
106
|
tone: 'red',
|
|
80
107
|
text: `restack onto ${destination} conflicted — open the detail view for files`,
|
|
81
108
|
}
|
|
82
|
-
:
|
|
109
|
+
: failed.length
|
|
83
110
|
? {
|
|
84
111
|
tone: 'red',
|
|
85
|
-
text: `${
|
|
112
|
+
text: `${failed.join(', ')} failed — file a repair child targeting ${record.ticket?.id ?? record.slug}`,
|
|
86
113
|
}
|
|
87
114
|
: ready && mode === 'consent' && state.landing?.command?.kind !== 'land'
|
|
88
115
|
? {
|
|
89
116
|
tone: 'yellow',
|
|
90
|
-
text: `ready to
|
|
117
|
+
text: `ready to merge into ${destination} — press l, or ab merge ${record.slug}`,
|
|
91
118
|
}
|
|
92
119
|
: undefined
|
|
93
120
|
return {
|
|
@@ -112,9 +139,13 @@ export function projectIntegrationRow(
|
|
|
112
139
|
'verify',
|
|
113
140
|
verified,
|
|
114
141
|
current && !verified,
|
|
115
|
-
|
|
142
|
+
failed.length
|
|
143
|
+
? 'failed'
|
|
144
|
+
: current && !verified
|
|
145
|
+
? `${passed}/${expected.length}`
|
|
146
|
+
: undefined,
|
|
116
147
|
),
|
|
117
|
-
step('
|
|
148
|
+
step('merge', !!state.integration?.landing, ready, mode),
|
|
118
149
|
],
|
|
119
150
|
...(alert ? { alert } : {}),
|
|
120
151
|
}
|
|
@@ -174,7 +205,7 @@ export function enrichIntegrationRows(
|
|
|
174
205
|
child.title === 'title unavailable'
|
|
175
206
|
? (active?.collectionIdentity?.title ?? historical?.ticket?.title ?? child.title)
|
|
176
207
|
: child.title,
|
|
177
|
-
state: child.landed ? '
|
|
208
|
+
state: child.landed ? 'merged' : (active?.collectionIdentity?.phase ?? 'queued'),
|
|
178
209
|
}
|
|
179
210
|
})
|
|
180
211
|
// Historical contribution records can resolve several build slugs to the
|
|
@@ -247,9 +278,5 @@ export function nodeParentDistance(state: BuildState): string {
|
|
|
247
278
|
distance.parent === (node?.observedParent?.sha ?? state.nodeComparison?.parentSha)
|
|
248
279
|
? distance.count
|
|
249
280
|
: null
|
|
250
|
-
return count
|
|
251
|
-
? 'parent distance unknown'
|
|
252
|
-
: count === 0
|
|
253
|
-
? 'parent current'
|
|
254
|
-
: `parent ${count} commit${count === 1 ? '' : 's'} ahead`
|
|
281
|
+
return distanceSuffix(count, state.prState)
|
|
255
282
|
}
|
|
@@ -68,3 +68,28 @@ export function nodeLandingRuleDisplay(
|
|
|
68
68
|
? 'default rule for integration builds: consent'
|
|
69
69
|
: `rule ${rule.index + 1}: ${JSON.stringify(rule.snapshot)}`
|
|
70
70
|
}
|
|
71
|
+
|
|
72
|
+
/** Public merge vocabulary shared by terminal and web renderers. */
|
|
73
|
+
export const mergeVocabulary = {
|
|
74
|
+
title: 'Merge',
|
|
75
|
+
label: 'merge',
|
|
76
|
+
merged: 'merged',
|
|
77
|
+
consent: 'Merge awaits consent. Merge releases this build; Hold keeps it waiting.',
|
|
78
|
+
} as const
|
|
79
|
+
|
|
80
|
+
export function mergeSummary(build: {
|
|
81
|
+
landing?: BuildState['landing']
|
|
82
|
+
autoMerge: string
|
|
83
|
+
}): string {
|
|
84
|
+
const landing = build.landing
|
|
85
|
+
const status =
|
|
86
|
+
landing?.command?.kind === 'hold'
|
|
87
|
+
? 'held'
|
|
88
|
+
: landing?.decision?.mode === 'consent' && landing.command?.kind !== 'land'
|
|
89
|
+
? 'awaiting consent'
|
|
90
|
+
: build.autoMerge
|
|
91
|
+
return `${mergeVocabulary.label} ${status}`
|
|
92
|
+
}
|
|
93
|
+
export function mergedChildren(merged: number, total: number): string {
|
|
94
|
+
return `${merged}/${total} ${mergeVocabulary.merged}`
|
|
95
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { workTargetDistance } from './target-distance'
|
|
1
2
|
import { migrationIdentity, ticketMigrationsReducer } from '../../kernel/ticket-migrations'
|
|
2
3
|
import { projectRollback, type DashboardRollback } from './rollback'
|
|
3
4
|
import { dispatchUpgradeReducer, type DispatchUpgradeState } from '../../kernel/dispatch-upgrade'
|
|
@@ -133,6 +134,7 @@ export interface PipelineStep {
|
|
|
133
134
|
* `waiting` annotates merge. Rendered inside the `(…)` note, so outcome
|
|
134
135
|
* distinctions never rely on color alone. */
|
|
135
136
|
qualifier?:
|
|
137
|
+
| 'cancelled'
|
|
136
138
|
| 'failed'
|
|
137
139
|
| 'skipped'
|
|
138
140
|
| 'waiting'
|
|
@@ -193,6 +195,7 @@ export interface DashboardBuild {
|
|
|
193
195
|
}
|
|
194
196
|
tree?: TreeProjection
|
|
195
197
|
kind?: 'integration' | 'work'
|
|
198
|
+
targetDistance?: string
|
|
196
199
|
target?: string
|
|
197
200
|
integration?:
|
|
198
201
|
| 'reparenting'
|
|
@@ -202,11 +205,11 @@ export interface DashboardBuild {
|
|
|
202
205
|
| 'verifying'
|
|
203
206
|
| 'verification failed'
|
|
204
207
|
| 'awaiting consent'
|
|
205
|
-
| 'ready to
|
|
206
|
-
| 'human
|
|
207
|
-
| 'fenced
|
|
208
|
-
| 'unfenced
|
|
209
|
-
| 'unverified
|
|
208
|
+
| 'ready to merge'
|
|
209
|
+
| 'human merge'
|
|
210
|
+
| 'fenced merge'
|
|
211
|
+
| 'unfenced merge'
|
|
212
|
+
| 'unverified merge'
|
|
210
213
|
slug: string
|
|
211
214
|
status: EffectiveStatus
|
|
212
215
|
/** True when the build is BOTH paused and blocked: blocked wins the status
|
|
@@ -436,7 +439,7 @@ export function autoMergeDisplay(state: BuildState): AutoMergeDisplay {
|
|
|
436
439
|
* so the terminal row/detail and the web row/detail say the same words, and
|
|
437
440
|
* so it names the per-build control that unblocks the parked build. */
|
|
438
441
|
export function autoMergeConsentReason(slug: string): string {
|
|
439
|
-
return `
|
|
442
|
+
return `Merge awaits consent — use ab merge ${slug}; use ab hold ${slug} to withdraw consent`
|
|
440
443
|
}
|
|
441
444
|
|
|
442
445
|
/**
|
|
@@ -450,6 +453,7 @@ export function autoMergeConsentReason(slug: string): string {
|
|
|
450
453
|
interface StepExtra {
|
|
451
454
|
producedOutput?: boolean
|
|
452
455
|
qualifier?:
|
|
456
|
+
| 'cancelled'
|
|
453
457
|
| 'failed'
|
|
454
458
|
| 'skipped'
|
|
455
459
|
| 'waiting'
|
|
@@ -613,6 +617,8 @@ export function projectBuildFromFacts(
|
|
|
613
617
|
return {
|
|
614
618
|
slug: record.slug,
|
|
615
619
|
...buildVocabulary(state),
|
|
620
|
+
target: state.target?.ticket.id ?? state.baseBranch ?? config.baseBranch,
|
|
621
|
+
targetDistance: workTargetDistance(state, facts.log.restack),
|
|
616
622
|
tree: projectTree(record, state, facts.log.restack, pipeline.verify.steps),
|
|
617
623
|
integrationRow: projectIntegrationRow(record, state, facts.log.restack, config),
|
|
618
624
|
integrationDetail: projectIntegrationDetail(
|
|
@@ -657,6 +663,9 @@ export function projectBuildFromFacts(
|
|
|
657
663
|
return {
|
|
658
664
|
slug: record.slug,
|
|
659
665
|
...buildVocabulary(state),
|
|
666
|
+
target: state.target?.ticket.id ?? state.baseBranch ?? config.baseBranch,
|
|
667
|
+
targetDistance:
|
|
668
|
+
state.kind === 'node' ? undefined : workTargetDistance(state, facts.log.restack),
|
|
660
669
|
tree: projectTree(record, state, facts.log.restack, pipeline.verify.steps),
|
|
661
670
|
integrationRow: projectIntegrationRow(record, state, facts.log.restack, config),
|
|
662
671
|
integrationDetail: projectIntegrationDetail(
|
|
@@ -761,18 +770,19 @@ export function projectBuildFromFacts(
|
|
|
761
770
|
// already has the log in hand). A running build keeps its open interval live
|
|
762
771
|
// (the renderer ticks it against `now`); a paused build freezes every open
|
|
763
772
|
// interval at its acknowledgement (including while RESUMING), while a
|
|
764
|
-
// blocked build freezes at the latest durable event. Timers
|
|
765
|
-
// advance behind either gate (AC 10). Each step scopes by the SAME seq boundary its state uses, so
|
|
773
|
+
// blocked build freezes at the latest non-distance durable event. Timers do
|
|
774
|
+
// not advance behind either gate (AC 10). Each step scopes by the SAME seq boundary its state uses, so
|
|
766
775
|
// durations and states restart in lockstep (AC 12).
|
|
767
776
|
const intervals = dashboard.intervals
|
|
768
777
|
const pausedAt = state.status === 'paused' ? dashboard.pausedAt : undefined
|
|
778
|
+
const activityAt = facts.log.restack.activityAt ?? state.lastEvent?.ts
|
|
769
779
|
const frozenNow =
|
|
770
780
|
state.status === 'running'
|
|
771
781
|
? undefined
|
|
772
782
|
: pausedAt !== undefined
|
|
773
783
|
? Date.parse(pausedAt)
|
|
774
|
-
:
|
|
775
|
-
? Date.parse(
|
|
784
|
+
: activityAt !== undefined
|
|
785
|
+
? Date.parse(activityAt)
|
|
776
786
|
: undefined
|
|
777
787
|
|
|
778
788
|
// ── Shared derivations ────────────────────────────────────────────────────
|
|
@@ -865,7 +875,10 @@ export function projectBuildFromFacts(
|
|
|
865
875
|
|
|
866
876
|
for (const s of pipeline.verify.steps) {
|
|
867
877
|
const phase = verifyPhase(s)
|
|
868
|
-
const current =
|
|
878
|
+
const current =
|
|
879
|
+
(
|
|
880
|
+
state.verify.running ?? (state.verify.currentStep ? [state.verify.currentStep] : [])
|
|
881
|
+
).includes(s) && activePhase !== undefined
|
|
869
882
|
const stepResults = cycle.filter((r) => r.step === s)
|
|
870
883
|
// The attempt COUNT comes from `currentPhase.attempt` for the running step
|
|
871
884
|
// — the attempt ACTUALLY running (`verify.started` populates it directly),
|
|
@@ -888,12 +901,20 @@ export function projectBuildFromFacts(
|
|
|
888
901
|
steps.push(
|
|
889
902
|
step(phase, !cycleFailed && verifySatisfied(s), current, {
|
|
890
903
|
producedOutput: stepResults.length > 0,
|
|
891
|
-
qualifier:
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
904
|
+
qualifier: Object.values(state.verifyStage.cancellations).some(
|
|
905
|
+
(c) => c.seq > cycleSince && c.step === s,
|
|
906
|
+
)
|
|
907
|
+
? 'cancelled'
|
|
908
|
+
: stepResults.some((r) => r.outcome === 'fail')
|
|
909
|
+
? 'failed'
|
|
910
|
+
: stepResults.some((r) => r.outcome === 'skipped')
|
|
911
|
+
? 'skipped'
|
|
912
|
+
: undefined,
|
|
913
|
+
reason:
|
|
914
|
+
Object.values(state.verifyStage.cancellations)
|
|
915
|
+
.filter((c) => c.seq > cycleSince && c.step === s)
|
|
916
|
+
.map((c) => `not run: cancelled by verify:${c.cause.step}`)
|
|
917
|
+
.at(-1) ?? stepResults.find((r) => r.skipCause === 'post-reconcile-policy')?.reason,
|
|
897
918
|
count,
|
|
898
919
|
timing: timingFor(intervals, phase, cycleSince, frozenNow),
|
|
899
920
|
}),
|
|
@@ -946,11 +967,10 @@ export function projectBuildFromFacts(
|
|
|
946
967
|
verifyDrained &&
|
|
947
968
|
postStepsDrained &&
|
|
948
969
|
activePhase === undefined
|
|
949
|
-
//
|
|
950
|
-
//
|
|
951
|
-
// is exactly when it became merge-ready, ticking like a running phase (AC 9).
|
|
970
|
+
// Advisory distance refreshes must not restart the merge waiting clock.
|
|
971
|
+
// Retain the last lifecycle activity when the engine parks awaiting its PR.
|
|
952
972
|
// Frozen at that same ts when the build is not running.
|
|
953
|
-
const lastMs =
|
|
973
|
+
const lastMs = activityAt === undefined ? 0 : Date.parse(activityAt)
|
|
954
974
|
const mergeTiming: StepTiming | undefined = !mergeCurrent
|
|
955
975
|
? undefined
|
|
956
976
|
: frozenNow !== undefined
|
|
@@ -963,10 +983,10 @@ export function projectBuildFromFacts(
|
|
|
963
983
|
if (mergeCurrent && !landingAuthorized(state.landing)) {
|
|
964
984
|
const reason =
|
|
965
985
|
state.landing?.command?.kind === 'hold'
|
|
966
|
-
? `
|
|
986
|
+
? `Merge held — use ab merge ${record.slug} when ready to release the hold`
|
|
967
987
|
: state.landing?.decision?.mode === 'consent'
|
|
968
988
|
? autoMergeConsentReason(record.slug)
|
|
969
|
-
: '
|
|
989
|
+
: 'Merge policy decision pending'
|
|
970
990
|
steps[steps.length - 1] = { ...steps[steps.length - 1]!, reason }
|
|
971
991
|
}
|
|
972
992
|
|
|
@@ -995,6 +1015,9 @@ export function projectBuildFromFacts(
|
|
|
995
1015
|
return {
|
|
996
1016
|
slug: record.slug,
|
|
997
1017
|
...buildVocabulary(state),
|
|
1018
|
+
target: state.target?.ticket.id ?? state.baseBranch ?? config.baseBranch,
|
|
1019
|
+
targetDistance:
|
|
1020
|
+
state.kind === 'node' ? undefined : workTargetDistance(state, facts.log.restack),
|
|
998
1021
|
tree: projectTree(record, state, facts.log.restack, pipeline.verify.steps),
|
|
999
1022
|
integrationRow: projectIntegrationRow(record, state, facts.log.restack, config),
|
|
1000
1023
|
integrationDetail: projectIntegrationDetail(record, state, facts.log.restack, config, pipeline),
|
|
@@ -1033,7 +1056,7 @@ export function projectBuildFromFacts(
|
|
|
1033
1056
|
? 'integration awaits verification'
|
|
1034
1057
|
: !landingAuthorized(state.landing)
|
|
1035
1058
|
? 'integration awaits explicit per-build consent'
|
|
1036
|
-
: 'integration awaits guarded
|
|
1059
|
+
: 'integration awaits guarded merge',
|
|
1037
1060
|
}),
|
|
1038
1061
|
]
|
|
1039
1062
|
: steps,
|
|
@@ -1413,11 +1436,11 @@ export function buildVocabulary(state: BuildState): {
|
|
|
1413
1436
|
| 'verifying'
|
|
1414
1437
|
| 'verification failed'
|
|
1415
1438
|
| 'awaiting consent'
|
|
1416
|
-
| 'ready to
|
|
1417
|
-
| 'human
|
|
1418
|
-
| 'fenced
|
|
1419
|
-
| 'unfenced
|
|
1420
|
-
| 'unverified
|
|
1439
|
+
| 'ready to merge'
|
|
1440
|
+
| 'human merge'
|
|
1441
|
+
| 'fenced merge'
|
|
1442
|
+
| 'unfenced merge'
|
|
1443
|
+
| 'unverified merge'
|
|
1421
1444
|
} {
|
|
1422
1445
|
return {
|
|
1423
1446
|
kind: state.kind === 'node' ? treeVocabulary.integrationKind : treeVocabulary.work,
|
|
@@ -1429,13 +1452,13 @@ export function buildVocabulary(state: BuildState): {
|
|
|
1429
1452
|
integration:
|
|
1430
1453
|
state.integration?.audit &&
|
|
1431
1454
|
state.integration.audit.verifiedTree !== state.integration.audit.landedTree
|
|
1432
|
-
? 'unverified
|
|
1455
|
+
? 'unverified merge'
|
|
1433
1456
|
: state.integration?.landing?.provenance === 'human'
|
|
1434
|
-
? 'human
|
|
1457
|
+
? 'human merge'
|
|
1435
1458
|
: state.integration?.landing
|
|
1436
1459
|
? state.integration.landing.fenced
|
|
1437
|
-
? 'fenced
|
|
1438
|
-
: 'unfenced
|
|
1460
|
+
? 'fenced merge'
|
|
1461
|
+
: 'unfenced merge'
|
|
1439
1462
|
: state.nodeRestack?.parentRequest || state.nodeRestack?.parentChange
|
|
1440
1463
|
? 'reparenting'
|
|
1441
1464
|
: integrationFailed(state)
|
|
@@ -27,7 +27,7 @@ export interface DashboardBuildReader {
|
|
|
27
27
|
listBuildsForRepo(repo: string): Promise<BuildRecord[]>
|
|
28
28
|
getEvents(slug: string, sinceSeq?: number): Promise<AbEvent[]>
|
|
29
29
|
listStreams?(scope: StreamScope): Promise<StreamRecord[]>
|
|
30
|
-
getArtifact?(slug: string, kind: string): Promise<Artifact | null>
|
|
30
|
+
getArtifact?(slug: string, kind: string, rev?: number): Promise<Artifact | null>
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
export interface DashboardPollSnapshot {
|
|
@@ -140,13 +140,19 @@ export class DashboardBuildPollCache {
|
|
|
140
140
|
* (config absent); all failures are display-only. */
|
|
141
141
|
private async readEffectiveConfig(
|
|
142
142
|
slug: string,
|
|
143
|
+
pin?: BuildState['verify']['configPin'],
|
|
143
144
|
): Promise<
|
|
144
145
|
{ revision?: number; pipelineSource?: PipelineSourceMeta; config?: Config } | undefined
|
|
145
146
|
> {
|
|
146
147
|
const getArtifact = this.reader.getArtifact
|
|
147
148
|
if (getArtifact === undefined) return undefined
|
|
148
149
|
try {
|
|
149
|
-
const artifact = await getArtifact.call(
|
|
150
|
+
const artifact = await getArtifact.call(
|
|
151
|
+
this.reader,
|
|
152
|
+
slug,
|
|
153
|
+
pin?.artifact.kind ?? BUILD_EFFECTIVE_CONFIG_ARTIFACT,
|
|
154
|
+
pin?.artifact.rev,
|
|
155
|
+
)
|
|
150
156
|
if (artifact === null) return undefined
|
|
151
157
|
let config: Config | undefined
|
|
152
158
|
try {
|
|
@@ -176,7 +182,7 @@ export class DashboardBuildPollCache {
|
|
|
176
182
|
): Promise<DashboardBuild | null> {
|
|
177
183
|
const [streams, artifact] = await Promise.all([
|
|
178
184
|
this.readStreams(record.slug),
|
|
179
|
-
this.readEffectiveConfig(record.slug),
|
|
185
|
+
this.readEffectiveConfig(record.slug, state.verify.configPin),
|
|
180
186
|
])
|
|
181
187
|
const pinnedConfig =
|
|
182
188
|
artifact?.config !== undefined ? composeBuildConfig(artifact.config, config) : undefined
|
|
@@ -33,7 +33,12 @@ import type {
|
|
|
33
33
|
DashboardSelection,
|
|
34
34
|
PipelineStep,
|
|
35
35
|
} from './model'
|
|
36
|
-
import {
|
|
36
|
+
import {
|
|
37
|
+
landingPolicyDisplay,
|
|
38
|
+
mergeVocabulary,
|
|
39
|
+
mergeSummary,
|
|
40
|
+
mergedChildren,
|
|
41
|
+
} from './landing-display'
|
|
37
42
|
import { dashboardBuildControl, pauseResumeHelp } from './actions'
|
|
38
43
|
import type { DashboardSession } from './detail'
|
|
39
44
|
import type { TranscriptPresentation, TranscriptTurn } from './transcript'
|
|
@@ -230,15 +235,15 @@ const STEP_COLOR: Record<PipelineStep['state'], ColorName> = {
|
|
|
230
235
|
|
|
231
236
|
/**
|
|
232
237
|
* Elapsed duration, ASCII only: `Xs` under a minute, `MmSSs` under an hour,
|
|
233
|
-
* `
|
|
234
|
-
* the field width is stable as it ticks (`38s`, `4m12s`, `
|
|
238
|
+
* `HhMMmSSs` above — seconds/minutes zero-padded when a larger unit precedes, so
|
|
239
|
+
* the field width is stable as it ticks (`38s`, `4m12s`, `1h04m07s`).
|
|
235
240
|
*/
|
|
236
241
|
export function formatDuration(ms: number): string {
|
|
237
242
|
const totalSec = Math.max(0, Math.floor(ms / 1000))
|
|
238
243
|
if (totalSec < 60) return `${totalSec}s`
|
|
239
244
|
const totalMin = Math.floor(totalSec / 60)
|
|
240
245
|
if (totalMin < 60) return `${totalMin}m${String(totalSec % 60).padStart(2, '0')}s`
|
|
241
|
-
return `${Math.floor(totalMin / 60)}h${String(totalMin % 60).padStart(2, '0')}m`
|
|
246
|
+
return `${Math.floor(totalMin / 60)}h${String(totalMin % 60).padStart(2, '0')}m${String(totalSec % 60).padStart(2, '0')}s`
|
|
242
247
|
}
|
|
243
248
|
|
|
244
249
|
function renderStep(step: PipelineStep, color: boolean, now: number): string {
|
|
@@ -297,6 +302,25 @@ function rightPinnedLine(prefix: string, flexible: string, right: string, width:
|
|
|
297
302
|
return truncate(`${prefix}${left}${gap}${right}`, width)
|
|
298
303
|
}
|
|
299
304
|
|
|
305
|
+
/** Preserve lifecycle, then destination, then identity as space tightens. */
|
|
306
|
+
function buildHeader(
|
|
307
|
+
prefix: string,
|
|
308
|
+
slug: string,
|
|
309
|
+
destination: string,
|
|
310
|
+
right: string,
|
|
311
|
+
width: number,
|
|
312
|
+
status: string,
|
|
313
|
+
): string {
|
|
314
|
+
const pinned = visibleLength(right) > width ? truncate(status, width) : right
|
|
315
|
+
const available = Math.max(0, width - visibleLength(pinned) - 1)
|
|
316
|
+
const identityPrefix = truncate(prefix, available)
|
|
317
|
+
const target = truncate(destination, Math.max(0, available - visibleLength(identityPrefix)))
|
|
318
|
+
const identityBudget = Math.max(0, available - visibleLength(target))
|
|
319
|
+
const identity = truncate(slug, Math.max(0, identityBudget - visibleLength(identityPrefix)))
|
|
320
|
+
const left = `${identityPrefix}${identity}${target}`
|
|
321
|
+
return `${left}${' '.repeat(Math.max(0, width - visibleLength(left) - visibleLength(pinned)))}${pinned}`
|
|
322
|
+
}
|
|
323
|
+
|
|
300
324
|
function reviewRoundCeilingText(build: DashboardBuild): string | undefined {
|
|
301
325
|
if (build.reviewRoundCeilings === undefined) return undefined
|
|
302
326
|
const values = [
|
|
@@ -351,14 +375,7 @@ function renderBuild(
|
|
|
351
375
|
: build.autoMerge === 'cancelling'
|
|
352
376
|
? 'yellow'
|
|
353
377
|
: 'dim'
|
|
354
|
-
if (build.kind !== 'integration')
|
|
355
|
-
rightTokens.push(
|
|
356
|
-
paint(
|
|
357
|
-
`landing ${build.landing?.command?.kind === 'hold' ? 'held' : build.landing?.decision?.mode === 'consent' && build.landing.command?.kind !== 'land' ? 'awaiting consent' : build.autoMerge}`,
|
|
358
|
-
autoColor,
|
|
359
|
-
color,
|
|
360
|
-
),
|
|
361
|
-
)
|
|
378
|
+
if (build.kind !== 'integration') rightTokens.push(paint(mergeSummary(build), autoColor, color))
|
|
362
379
|
}
|
|
363
380
|
if (build.pr !== undefined) rightTokens.push(link(build.pr.url, `PR ${build.pr.state}`, color))
|
|
364
381
|
// A repository hold changes no build lifecycle state. Keep QUEUED literal
|
|
@@ -377,19 +394,27 @@ function renderBuild(
|
|
|
377
394
|
|
|
378
395
|
// The slug is the sole flexible segment; narrow frames truncate it before
|
|
379
396
|
// the right-pinned lifecycle status.
|
|
380
|
-
const
|
|
397
|
+
const destination = build.integrationRow?.destination ?? build.target
|
|
398
|
+
const suffix = build.integrationRow?.parentDistance ?? build.targetDistance ?? '+?'
|
|
399
|
+
const target = destination
|
|
400
|
+
? ` → ${displayText(destination)}${suffix ? ` ${paint(suffix, 'dim', color)}` : ''}`
|
|
401
|
+
: ''
|
|
402
|
+
const lines = [
|
|
403
|
+
buildHeader(
|
|
404
|
+
leftPrefix,
|
|
405
|
+
paint(build.slug, 'bold', color),
|
|
406
|
+
target,
|
|
407
|
+
rightStr,
|
|
408
|
+
width,
|
|
409
|
+
paint(build.status.toUpperCase(), STATUS_COLOR[build.status], color),
|
|
410
|
+
),
|
|
411
|
+
]
|
|
381
412
|
if (build.integrationRow) {
|
|
382
413
|
const row = build.integrationRow
|
|
383
414
|
const { bar, counts } = integrationProgress(row, color)
|
|
384
415
|
lines.push(
|
|
385
416
|
...packLines(
|
|
386
|
-
[
|
|
387
|
-
paint(`integration → ${row.destination}`, 'bold', color),
|
|
388
|
-
bar,
|
|
389
|
-
...(row.parentDistance ? [paint(row.parentDistance, 'dim', color)] : []),
|
|
390
|
-
...counts,
|
|
391
|
-
...(row.verified ? [paint('· verified', 'green', color)] : []),
|
|
392
|
-
],
|
|
417
|
+
[bar, ...counts, ...(row.verified ? [paint('· verified', 'green', color)] : [])],
|
|
393
418
|
width,
|
|
394
419
|
' ',
|
|
395
420
|
),
|
|
@@ -406,13 +431,6 @@ function renderBuild(
|
|
|
406
431
|
lines.push(paint(` ! ${line}`, row.alert.tone, color))
|
|
407
432
|
return lines
|
|
408
433
|
}
|
|
409
|
-
if (build.target)
|
|
410
|
-
lines.push(
|
|
411
|
-
truncate(
|
|
412
|
-
` ${build.kind ?? treeVocabulary.work} · ${treeVocabulary.target} ${build.target}${build.integration ? ` · ${build.integration}` : ''}`,
|
|
413
|
-
width,
|
|
414
|
-
),
|
|
415
|
-
)
|
|
416
434
|
if (build.tree && (build.kind === 'integration' || build.tree.consent)) {
|
|
417
435
|
const tree = build.tree
|
|
418
436
|
for (const text of [
|
|
@@ -523,13 +541,13 @@ function frameWidths(builds: DashboardBuild[], harvest: DashboardHarvest | undef
|
|
|
523
541
|
// ── The frame ────────────────────────────────────────────────────────────────
|
|
524
542
|
|
|
525
543
|
export const DASHBOARD_GLOBAL_LEGEND =
|
|
526
|
-
'Keys: Up/Down select h harvest l
|
|
544
|
+
'Keys: Up/Down select h harvest l merge o hold i intake p pause all r resume all Ctrl-C quit'
|
|
527
545
|
export const DASHBOARD_HARVEST_LEGEND = 'Keys: Up/Down select Ctrl-C quit'
|
|
528
546
|
export const DASHBOARD_HARVEST_RESUME_LEGEND = 'Keys: Up/Down select p resume Ctrl-C quit'
|
|
529
547
|
export const DASHBOARD_HARVEST_ACKNOWLEDGE_LEGEND =
|
|
530
548
|
'Keys: Up/Down select p acknowledge Ctrl-C quit'
|
|
531
549
|
export const DASHBOARD_BUILD_LEGEND =
|
|
532
|
-
'Keys: Up/Down select Enter details l
|
|
550
|
+
'Keys: Up/Down select Enter details l merge o hold p pause a abort Ctrl-C quit'
|
|
533
551
|
export const DASHBOARD_QUEUED_BUILD_LEGEND =
|
|
534
552
|
'Keys: Up/Down select Enter details d discard a abort Ctrl-C quit'
|
|
535
553
|
/** The session view offers ONLY scrolling, back, and quit — it is read-only,
|
|
@@ -553,8 +571,8 @@ function buildLegend(build: DashboardBuild, detail: boolean): string {
|
|
|
553
571
|
const control = dashboardBuildControl(build.status)
|
|
554
572
|
const action = control === undefined ? '' : ` ${control.key} ${control.label}`
|
|
555
573
|
return detail
|
|
556
|
-
? `Keys: Up/Down scroll Left/Right select session Enter transcript l
|
|
557
|
-
: `Keys: Up/Down select Enter details l
|
|
574
|
+
? `Keys: Up/Down scroll Left/Right select session Enter transcript l merge o hold${action} a abort Esc back Ctrl-C quit`
|
|
575
|
+
: `Keys: Up/Down select Enter details l merge o hold${action} a abort Ctrl-C quit`
|
|
558
576
|
}
|
|
559
577
|
|
|
560
578
|
const MESSAGE_PREVIEW_ROWS = 3
|
|
@@ -717,7 +735,7 @@ function integrationProgress(row: NonNullable<DashboardBuild['integrationRow']>,
|
|
|
717
735
|
paint('─'.repeat(children.total ? cells[2]! : 22), 'dim', color)
|
|
718
736
|
counts = children.total
|
|
719
737
|
? [
|
|
720
|
-
paint(
|
|
738
|
+
paint(mergedChildren(children.landed, children.total), 'green', color),
|
|
721
739
|
...(children.building ? [paint(`· ${children.building} building`, 'cyan', color)] : []),
|
|
722
740
|
...(children.queued ? [paint(`· ${children.queued} queued`, 'dim', color)] : []),
|
|
723
741
|
]
|
|
@@ -737,7 +755,7 @@ function detailBody(
|
|
|
737
755
|
if (build.ticketId !== undefined) body.push(` ticket ${displayText(build.ticketId)}`)
|
|
738
756
|
if (build.target && !build.integrationDetail)
|
|
739
757
|
body.push(
|
|
740
|
-
` ${build.kind ?? treeVocabulary.work} · ${treeVocabulary.target} ${build.target}${build.integration ? ` · ${build.integration}` : ''}`,
|
|
758
|
+
` ${build.kind ?? treeVocabulary.work} · ${treeVocabulary.target} ${build.target}${build.targetDistance ? ` ${build.targetDistance}` : ''}${build.integration ? ` · ${build.integration}` : ''}`,
|
|
741
759
|
)
|
|
742
760
|
if (
|
|
743
761
|
!build.integrationDetail &&
|
|
@@ -773,7 +791,10 @@ function detailBody(
|
|
|
773
791
|
body.push(...packLines(['Progress', progress.bar, ...progress.counts], width, ' '))
|
|
774
792
|
field(handPushedLabel, handPushedText(detail.handPushedCommits))
|
|
775
793
|
field('Branch', `${detail.branch} · restack ${detail.restack}`)
|
|
776
|
-
|
|
794
|
+
field(
|
|
795
|
+
'Parent',
|
|
796
|
+
`${build.integrationRow.destination}${detail.parentDistance ? ` ${detail.parentDistance}` : ''}`,
|
|
797
|
+
)
|
|
777
798
|
for (const path of detail.conflictFiles ?? []) field('Conflict', path)
|
|
778
799
|
body.push(
|
|
779
800
|
...packLines(
|
|
@@ -786,7 +807,7 @@ function detailBody(
|
|
|
786
807
|
body.push(
|
|
787
808
|
'',
|
|
788
809
|
paint(
|
|
789
|
-
`Children ${open} open · ${detail.children.length - open}
|
|
810
|
+
`Children ${open} open · ${detail.children.length - open} ${mergeVocabulary.merged}${detail.membershipKnown ? '' : ' · membership unknown'}`,
|
|
790
811
|
'bold',
|
|
791
812
|
color,
|
|
792
813
|
),
|
|
@@ -805,9 +826,10 @@ function detailBody(
|
|
|
805
826
|
body.push('')
|
|
806
827
|
field('Verification', detail.verification)
|
|
807
828
|
for (const result of detail.verifySteps) field(result.step, result.outcome)
|
|
808
|
-
field(
|
|
829
|
+
field(mergeVocabulary.title, detail.landing)
|
|
809
830
|
}
|
|
810
|
-
if (build.kind !== 'integration')
|
|
831
|
+
if (build.kind !== 'integration')
|
|
832
|
+
body.push(` ${mergeVocabulary.label} ${landingPolicyDisplay(build.landing)}`)
|
|
811
833
|
const ceiling = reviewRoundCeilingText(build)
|
|
812
834
|
if (ceiling !== undefined) body.push(` ${ceiling}`)
|
|
813
835
|
if (build.pr !== undefined)
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { BuildState } from '../../kernel/reducer'
|
|
2
|
+
import type { LeafRestackState } from '../../kernel/leaf-restack-state'
|
|
3
|
+
|
|
4
|
+
export function distanceSuffix(count: number | null | undefined, terminal?: string): string {
|
|
5
|
+
if (terminal === 'merged' || terminal === 'closed') return ''
|
|
6
|
+
if (count == null || !Number.isSafeInteger(count) || count < 0) return '+?'
|
|
7
|
+
return count === 0 ? '' : `+${count}`
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function workTargetDistance(state: BuildState, restack: LeafRestackState): string {
|
|
11
|
+
const sample = restack.distance
|
|
12
|
+
const valid = sample && sample.branch === state.baseBranch && sample.sha === restack.target?.sha
|
|
13
|
+
return distanceSuffix(valid ? sample.count : null, state.prState)
|
|
14
|
+
}
|