@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
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
import { ticketPreparationReducer } from './ticket-preparation'
|
|
2
|
-
import { ticketHandbacksReducer } from './ticket-handbacks'
|
|
3
|
-
import { ticketStartsReducer } from './ticket-starts'
|
|
4
1
|
import { ticketMigrationsReducer } from './ticket-migrations'
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
advanceCompatibility,
|
|
8
|
-
initialCompatibility,
|
|
9
|
-
projectEvents,
|
|
10
|
-
type CompatibilityState,
|
|
11
|
-
} from '../events/compatibility'
|
|
2
|
+
import { projectEvents } from '../events/compatibility'
|
|
12
3
|
import { awaitsConsent } from './landing-readiness'
|
|
13
4
|
import { leafRestackReducer, type LeafRestackState } from './leaf-restack-state'
|
|
14
5
|
import { landingCandidateId } from './landing-policy'
|
|
@@ -621,364 +612,11 @@ export const buildReadFactsReducer = defineReducer({
|
|
|
621
612
|
}),
|
|
622
613
|
})
|
|
623
614
|
|
|
624
|
-
|
|
625
|
-
import { repositoryAttentionReducer } from './repository-attention'
|
|
626
|
-
import { dispatchSettingsReducer } from './dispatch-settings'
|
|
627
|
-
import { harvestReducer } from './harvest'
|
|
628
|
-
import { forgeCredentialLimitsReducer, forgeHealthReducer } from './forge-health'
|
|
629
|
-
import { kernelGitHealthReducer } from './kernel-git'
|
|
630
|
-
import { openPrBackpressureReducer } from './open-pr-backpressure-state'
|
|
631
|
-
import { ticketSourceHealthReducer } from './ticket-source-health'
|
|
632
|
-
import { autoMergeDefaultReducer } from './auto-merge-default'
|
|
633
|
-
import { effectiveConfigReducer } from './service-facts'
|
|
634
|
-
import { sandboxStatesReducer } from '../processes/sandbox-state'
|
|
635
|
-
import { openHarvestExecutionsReducer } from '../processes/harvest-execution-state'
|
|
636
|
-
import {
|
|
637
|
-
dispatchStatusReducer,
|
|
638
|
-
foldReportedDispatch,
|
|
639
|
-
initialReportedDispatch,
|
|
615
|
+
export {
|
|
640
616
|
RECENT_DISPATCH_RUN_LIMIT,
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
preparation: ReturnType<typeof ticketPreparationReducer.initial>
|
|
648
|
-
handbacks: ReturnType<typeof ticketHandbacksReducer.initial>
|
|
649
|
-
ticketStarts: ReturnType<typeof ticketStartsReducer.initial>
|
|
650
|
-
compatibility: CompatibilityState
|
|
651
|
-
presence: Record<
|
|
652
|
-
string,
|
|
653
|
-
Extract<RepositoryEvent, { type: 'change-presence.observed' }>['payload']
|
|
654
|
-
>
|
|
655
|
-
|
|
656
|
-
upgrades: ReturnType<typeof dispatchUpgradeReducer.initial>
|
|
657
|
-
openHarvest: ReturnType<typeof openHarvestExecutionsReducer.initial>
|
|
658
|
-
attention: ReturnType<typeof repositoryAttentionReducer.initial>
|
|
659
|
-
harvestFailures: Record<
|
|
660
|
-
string,
|
|
661
|
-
{ count: number; latest: Extract<RepositoryEvent, { type: 'harvest.failed' }> }
|
|
662
|
-
>
|
|
663
|
-
harvestTerminals: Record<
|
|
664
|
-
string,
|
|
665
|
-
Extract<RepositoryEvent, { type: 'harvest.proposals.submitted' | 'harvest.review.verdict' }>
|
|
666
|
-
>
|
|
667
|
-
harvestVerdicts: Record<
|
|
668
|
-
string,
|
|
669
|
-
{
|
|
670
|
-
first: Extract<RepositoryEvent, { type: 'harvest.review.verdict' }>
|
|
671
|
-
latest: Extract<RepositoryEvent, { type: 'harvest.review.verdict' }>
|
|
672
|
-
}
|
|
673
|
-
>
|
|
674
|
-
harvestAuthorizations: Record<
|
|
675
|
-
string,
|
|
676
|
-
Extract<RepositoryEvent, { type: 'harvest.execution.authorized' }>
|
|
677
|
-
>
|
|
678
|
-
harvestExecutionStarts: Record<string, string>
|
|
679
|
-
latestHarvestResumedSeq: number
|
|
680
|
-
harvestSessionEndings: Record<string, number>
|
|
681
|
-
harvestSessions: (import('../cli/harvest').HarvestSessionStatusView & { run: string })[]
|
|
682
|
-
pendingHumanResume?: number
|
|
683
|
-
dismissedThrough: number
|
|
684
|
-
failedAt: Record<string, string>
|
|
685
|
-
settings: ReturnType<typeof dispatchSettingsReducer.initial>
|
|
686
|
-
harvest: ReturnType<typeof harvestReducer.initial>
|
|
687
|
-
forgeHealth: ReturnType<typeof forgeHealthReducer.initial>
|
|
688
|
-
forgeCredentialLimits: ReturnType<typeof forgeCredentialLimitsReducer.initial>
|
|
689
|
-
kernelGit: ReturnType<typeof kernelGitHealthReducer.initial>
|
|
690
|
-
openPrBackpressure: ReturnType<typeof openPrBackpressureReducer.initial>
|
|
691
|
-
ticketMigrations: ReturnType<typeof ticketMigrationsReducer.initial>
|
|
692
|
-
health: ReturnType<typeof ticketSourceHealthReducer.initial>
|
|
693
|
-
autoMerge: ReturnType<typeof autoMergeDefaultReducer.initial>
|
|
694
|
-
config: ReturnType<typeof effectiveConfigReducer.initial>
|
|
695
|
-
sandboxes: ReturnType<typeof sandboxStatesReducer.initial>
|
|
696
|
-
/** The dispatcher run the reduced status describes; see `foldReportedDispatch`. */
|
|
697
|
-
dispatch: ReportedDispatch
|
|
698
|
-
scanSeq?: number
|
|
699
|
-
scan?: Extract<RepositoryEvent, { type: 'dispatcher.ticket-scan-completed' }>['payload']
|
|
700
|
-
recentRuns: [string, DispatcherRunFacts][]
|
|
701
|
-
latestRun?: string
|
|
702
|
-
latestStoppedRun?: string
|
|
703
|
-
publications: Extract<RepositoryEvent, { type: 'orchestrator.sandbox.published' }>[]
|
|
704
|
-
}
|
|
705
|
-
export const repositoryReadFactsReducer = defineReducer({
|
|
706
|
-
rawEvents: true,
|
|
707
|
-
identity: 'repositoryReadFacts',
|
|
708
|
-
parts: [
|
|
709
|
-
ticketMigrationsReducer,
|
|
710
|
-
dispatchUpgradeReducer,
|
|
711
|
-
ticketPreparationReducer,
|
|
712
|
-
ticketHandbacksReducer,
|
|
713
|
-
ticketStartsReducer,
|
|
714
|
-
dispatcherRunFactsReducer('version'),
|
|
715
|
-
openHarvestExecutionsReducer,
|
|
716
|
-
forgeHealthReducer,
|
|
717
|
-
forgeCredentialLimitsReducer,
|
|
718
|
-
kernelGitHealthReducer,
|
|
719
|
-
openPrBackpressureReducer,
|
|
720
|
-
repositoryAttentionReducer,
|
|
721
|
-
dispatchSettingsReducer,
|
|
722
|
-
harvestReducer,
|
|
723
|
-
ticketSourceHealthReducer,
|
|
724
|
-
autoMergeDefaultReducer,
|
|
725
|
-
effectiveConfigReducer,
|
|
726
|
-
sandboxStatesReducer,
|
|
727
|
-
dispatchStatusReducer('version'),
|
|
728
|
-
],
|
|
729
|
-
initial: (): RepositoryReadAcc => ({
|
|
730
|
-
missingAccounts: {},
|
|
731
|
-
compatibility: initialCompatibility(),
|
|
732
|
-
presence: {},
|
|
733
|
-
preparation: ticketPreparationReducer.initial(),
|
|
734
|
-
handbacks: ticketHandbacksReducer.initial(),
|
|
735
|
-
ticketStarts: ticketStartsReducer.initial(),
|
|
736
|
-
upgrades: dispatchUpgradeReducer.initial(),
|
|
737
|
-
recentRuns: [],
|
|
738
|
-
openHarvest: openHarvestExecutionsReducer.initial(),
|
|
739
|
-
attention: repositoryAttentionReducer.initial(),
|
|
740
|
-
dismissedThrough: 0,
|
|
741
|
-
failedAt: {},
|
|
742
|
-
harvestSessions: [],
|
|
743
|
-
harvestSessionEndings: {},
|
|
744
|
-
harvestFailures: {},
|
|
745
|
-
harvestTerminals: {},
|
|
746
|
-
harvestVerdicts: {},
|
|
747
|
-
harvestAuthorizations: {},
|
|
748
|
-
latestHarvestResumedSeq: 0,
|
|
749
|
-
harvestExecutionStarts: {},
|
|
750
|
-
settings: dispatchSettingsReducer.initial(),
|
|
751
|
-
harvest: harvestReducer.initial(),
|
|
752
|
-
forgeHealth: forgeHealthReducer.initial(),
|
|
753
|
-
forgeCredentialLimits: forgeCredentialLimitsReducer.initial(),
|
|
754
|
-
kernelGit: kernelGitHealthReducer.initial(),
|
|
755
|
-
openPrBackpressure: openPrBackpressureReducer.initial(),
|
|
756
|
-
ticketMigrations: ticketMigrationsReducer.initial(),
|
|
757
|
-
health: ticketSourceHealthReducer.initial(),
|
|
758
|
-
autoMerge: autoMergeDefaultReducer.initial(),
|
|
759
|
-
config: effectiveConfigReducer.initial(),
|
|
760
|
-
sandboxes: sandboxStatesReducer.initial(),
|
|
761
|
-
dispatch: initialReportedDispatch(),
|
|
762
|
-
publications: [],
|
|
763
|
-
}),
|
|
764
|
-
fold(acc: RepositoryReadAcc, events: readonly RepositoryEvent[]) {
|
|
765
|
-
acc.preparation = ticketPreparationReducer.advance(acc.preparation, events)
|
|
766
|
-
acc.handbacks = ticketHandbacksReducer.advance(acc.handbacks, events)
|
|
767
|
-
acc.ticketStarts = ticketStartsReducer.advance(acc.ticketStarts, events)
|
|
768
|
-
advanceCompatibility(acc.compatibility, events)
|
|
769
|
-
acc.upgrades = dispatchUpgradeReducer.advance(acc.upgrades, events)
|
|
770
|
-
acc.attention = repositoryAttentionReducer.advance(acc.attention, events)
|
|
771
|
-
acc.openHarvest = openHarvestExecutionsReducer.advance(acc.openHarvest, events)
|
|
772
|
-
acc.settings = dispatchSettingsReducer.advance(acc.settings, events)
|
|
773
|
-
acc.harvest = harvestReducer.advance(acc.harvest, events)
|
|
774
|
-
acc.forgeHealth = forgeHealthReducer.advance(acc.forgeHealth, events)
|
|
775
|
-
acc.forgeCredentialLimits = forgeCredentialLimitsReducer.advance(
|
|
776
|
-
acc.forgeCredentialLimits,
|
|
777
|
-
events,
|
|
778
|
-
)
|
|
779
|
-
acc.kernelGit = kernelGitHealthReducer.advance(acc.kernelGit, events)
|
|
780
|
-
acc.openPrBackpressure = openPrBackpressureReducer.advance(acc.openPrBackpressure, events)
|
|
781
|
-
acc.ticketMigrations = ticketMigrationsReducer.advance(acc.ticketMigrations, events)
|
|
782
|
-
acc.health = ticketSourceHealthReducer.advance(acc.health, events)
|
|
783
|
-
acc.autoMerge = autoMergeDefaultReducer.advance(acc.autoMerge, events)
|
|
784
|
-
acc.config = effectiveConfigReducer.advance(acc.config, events)
|
|
785
|
-
acc.sandboxes = sandboxStatesReducer.advance(acc.sandboxes, events)
|
|
786
|
-
for (const event of projectEvents(events)) {
|
|
787
|
-
if (event.type === 'account.credentials-unavailable')
|
|
788
|
-
acc.missingAccounts[event.payload.name] = event.payload
|
|
789
|
-
if (event.type === 'account.credentials-recovered')
|
|
790
|
-
delete acc.missingAccounts[event.payload.name]
|
|
791
|
-
if (event.type === 'change-presence.observed')
|
|
792
|
-
acc.presence[event.payload.destination] = event.payload
|
|
793
|
-
if (event.type === 'harvest.failed') {
|
|
794
|
-
const key = JSON.stringify([event.payload.run, event.payload.step, event.payload.round])
|
|
795
|
-
acc.harvestFailures[key] = {
|
|
796
|
-
count: (acc.harvestFailures[key]?.count ?? 0) + 1,
|
|
797
|
-
latest: event,
|
|
798
|
-
}
|
|
799
|
-
}
|
|
800
|
-
if (
|
|
801
|
-
(event.type === 'harvest.proposals.submitted' || event.type === 'harvest.review.verdict') &&
|
|
802
|
-
event.actor.kind === 'agent'
|
|
803
|
-
)
|
|
804
|
-
acc.harvestTerminals[event.actor.session] = event
|
|
805
|
-
if (event.type === 'harvest.review.verdict') {
|
|
806
|
-
const key = JSON.stringify([event.payload.run, event.payload.round])
|
|
807
|
-
acc.harvestVerdicts[key] = {
|
|
808
|
-
first: acc.harvestVerdicts[key]?.first ?? event,
|
|
809
|
-
latest: event,
|
|
810
|
-
}
|
|
811
|
-
}
|
|
812
|
-
if (event.type === 'harvest.execution.started')
|
|
813
|
-
acc.harvestExecutionStarts[String(event.seq)] = event.payload.execution
|
|
814
|
-
if (event.type === 'harvest.execution.authorized')
|
|
815
|
-
acc.harvestAuthorizations[JSON.stringify(event.payload.execution)] ??= event
|
|
816
|
-
if (event.type === 'harvest.resumed') acc.latestHarvestResumedSeq = event.seq
|
|
817
|
-
if (event.type === 'harvest.session.started' && event.payload.continuation) {
|
|
818
|
-
const prior = acc.harvestSessions.find(
|
|
819
|
-
(s) => s.session === event.payload.continuation!.predecessor,
|
|
820
|
-
)
|
|
821
|
-
if (prior) prior.status = 'ended'
|
|
822
|
-
}
|
|
823
|
-
if (event.type === 'harvest.session.started')
|
|
824
|
-
acc.harvestSessions.push({
|
|
825
|
-
run: event.payload.run,
|
|
826
|
-
session: event.payload.session,
|
|
827
|
-
role: event.payload.role,
|
|
828
|
-
step: event.payload.step,
|
|
829
|
-
round: event.payload.round,
|
|
830
|
-
status: 'open',
|
|
831
|
-
...(event.payload.continuation ? { continuation: event.payload.continuation } : {}),
|
|
832
|
-
...(event.payload.stream === undefined ? {} : { stream: event.payload.stream }),
|
|
833
|
-
streamStatus: event.payload.stream === undefined ? 'closed' : 'open',
|
|
834
|
-
})
|
|
835
|
-
if (event.type === 'harvest.session.ended' || event.type === 'harvest.session.suspended') {
|
|
836
|
-
acc.harvestSessionEndings[JSON.stringify(event.payload.session)] ??= event.seq
|
|
837
|
-
const session = acc.harvestSessions.findLast(
|
|
838
|
-
(session) => session.session === event.payload.session && session.status === 'open',
|
|
839
|
-
)
|
|
840
|
-
if (session) {
|
|
841
|
-
session.status = event.type === 'harvest.session.suspended' ? 'suspended' : 'ended'
|
|
842
|
-
session.transcript = event.payload.transcript
|
|
843
|
-
session.streamStatus = 'closed'
|
|
844
|
-
}
|
|
845
|
-
}
|
|
846
|
-
if (event.type === 'harvest.resume-requested' && event.actor.kind === 'human')
|
|
847
|
-
acc.pendingHumanResume = event.seq
|
|
848
|
-
if (event.type === 'harvest.pause-requested') delete acc.pendingHumanResume
|
|
849
|
-
if (event.type === 'harvest.resumed' && acc.pendingHumanResume !== undefined)
|
|
850
|
-
acc.dismissedThrough = Math.max(acc.dismissedThrough, acc.pendingHumanResume)
|
|
851
|
-
if (event.type === 'harvest.failed' && !event.payload.willRetry)
|
|
852
|
-
acc.failedAt[JSON.stringify(event.payload.run)] = event.ts
|
|
853
|
-
foldReportedDispatch(acc.dispatch, event)
|
|
854
|
-
if (event.type === 'dispatcher.ticket-scan-completed') {
|
|
855
|
-
acc.scan = event.payload
|
|
856
|
-
acc.scanSeq = event.seq
|
|
857
|
-
}
|
|
858
|
-
if (event.type === 'dispatcher.run-started') acc.latestRun = event.payload.run
|
|
859
|
-
if (event.type === 'dispatcher.run-stopped') acc.latestStoppedRun = event.payload.run
|
|
860
|
-
if (
|
|
861
|
-
event.type.startsWith('dispatcher.') &&
|
|
862
|
-
'run' in event.payload &&
|
|
863
|
-
typeof event.payload.run === 'string'
|
|
864
|
-
) {
|
|
865
|
-
const run = event.payload.run
|
|
866
|
-
let entry = acc.recentRuns.find(([id]) => id === run)
|
|
867
|
-
if (!entry) {
|
|
868
|
-
entry = [run, {}]
|
|
869
|
-
acc.recentRuns.push(entry)
|
|
870
|
-
}
|
|
871
|
-
foldDispatcherRunFact(entry[1], event)
|
|
872
|
-
while (acc.recentRuns.length > RECENT_DISPATCH_RUN_LIMIT) {
|
|
873
|
-
const index = acc.recentRuns.findIndex(
|
|
874
|
-
([id]) => id !== acc.latestRun && id !== acc.latestStoppedRun,
|
|
875
|
-
)
|
|
876
|
-
acc.recentRuns.splice(index, 1)
|
|
877
|
-
}
|
|
878
|
-
}
|
|
879
|
-
if (event.type === 'orchestrator.sandbox.published') {
|
|
880
|
-
acc.publications = acc.publications.filter(
|
|
881
|
-
(prior) =>
|
|
882
|
-
prior.payload.operator !== event.payload.operator ||
|
|
883
|
-
prior.payload.branch !== event.payload.branch,
|
|
884
|
-
)
|
|
885
|
-
acc.publications.push(event)
|
|
886
|
-
}
|
|
887
|
-
}
|
|
888
|
-
},
|
|
889
|
-
finish: (acc: RepositoryReadAcc) => ({
|
|
890
|
-
missingAccounts: structuredClone(acc.missingAccounts),
|
|
891
|
-
compatibility: structuredClone(acc.compatibility),
|
|
892
|
-
presence: structuredClone(acc.presence),
|
|
893
|
-
preparation: ticketPreparationReducer.finish(acc.preparation),
|
|
894
|
-
handbacks: ticketHandbacksReducer.finish(acc.handbacks),
|
|
895
|
-
ticketStarts: ticketStartsReducer.finish(acc.ticketStarts),
|
|
896
|
-
upgrades: dispatchUpgradeReducer.finish(acc.upgrades),
|
|
897
|
-
harvestFailures: structuredClone(acc.harvestFailures),
|
|
898
|
-
harvestTerminals: structuredClone(acc.harvestTerminals),
|
|
899
|
-
harvestVerdicts: structuredClone(acc.harvestVerdicts),
|
|
900
|
-
harvestAuthorizations: structuredClone(acc.harvestAuthorizations),
|
|
901
|
-
harvestExecutionStarts: { ...acc.harvestExecutionStarts },
|
|
902
|
-
latestHarvestResumedSeq: acc.latestHarvestResumedSeq,
|
|
903
|
-
harvestSessionEndings: { ...acc.harvestSessionEndings },
|
|
904
|
-
harvestSessions: structuredClone(acc.harvestSessions),
|
|
905
|
-
attention: repositoryAttentionReducer.finish(acc.attention),
|
|
906
|
-
dismissedThrough: acc.dismissedThrough,
|
|
907
|
-
failedAt: { ...acc.failedAt },
|
|
908
|
-
openHarvest: openHarvestExecutionsReducer.finish(acc.openHarvest),
|
|
909
|
-
settings: dispatchSettingsReducer.finish(acc.settings),
|
|
910
|
-
harvest: harvestReducer.finish(acc.harvest),
|
|
911
|
-
forgeHealth: forgeHealthReducer.finish(acc.forgeHealth),
|
|
912
|
-
forgeCredentialLimits: forgeCredentialLimitsReducer.finish(acc.forgeCredentialLimits),
|
|
913
|
-
kernelGit: kernelGitHealthReducer.finish(acc.kernelGit),
|
|
914
|
-
openPrBackpressure: openPrBackpressureReducer.finish(acc.openPrBackpressure),
|
|
915
|
-
ticketMigrations: ticketMigrationsReducer.finish(acc.ticketMigrations),
|
|
916
|
-
health: ticketSourceHealthReducer.finish(acc.health),
|
|
917
|
-
autoMerge: autoMergeDefaultReducer.finish(acc.autoMerge),
|
|
918
|
-
config: effectiveConfigReducer.finish(acc.config),
|
|
919
|
-
sandboxes: sandboxStatesReducer.finish(acc.sandboxes),
|
|
920
|
-
status: acc.dispatch.run
|
|
921
|
-
? dispatchStatusReducer(acc.dispatch.run).finish(acc.dispatch.status)
|
|
922
|
-
: undefined,
|
|
923
|
-
scan: acc.scan,
|
|
924
|
-
scanSeq: acc.scanSeq,
|
|
925
|
-
recentRuns: structuredClone(acc.recentRuns),
|
|
926
|
-
latestRun: acc.latestRun,
|
|
927
|
-
latestStoppedRun: acc.latestStoppedRun,
|
|
928
|
-
publications: structuredClone(acc.publications),
|
|
929
|
-
}),
|
|
930
|
-
})
|
|
931
|
-
|
|
932
|
-
import type { IncrementalReducer } from './incremental'
|
|
933
|
-
/** Companion for an optional finished answer: absence is represented by an
|
|
934
|
-
* omitted object field, never top-level undefined. */
|
|
935
|
-
export function optionalValue<A, E, V>(reducer: IncrementalReducer<A, E, V>) {
|
|
936
|
-
return {
|
|
937
|
-
...reducer,
|
|
938
|
-
finish: (acc: A) => ({ value: reducer.finish(acc) }),
|
|
939
|
-
reduce: (events: readonly E[]) => ({ value: reducer.reduce(events) }),
|
|
940
|
-
}
|
|
941
|
-
}
|
|
942
|
-
|
|
943
|
-
/** One run's correlation facts. History for unrelated runs never enters this value. */
|
|
944
|
-
export interface DispatcherRunFacts {
|
|
945
|
-
runtime?: RepositoryEvent
|
|
946
|
-
start?: RepositoryEvent
|
|
947
|
-
latestStart?: RepositoryEvent
|
|
948
|
-
stop?: RepositoryEvent
|
|
949
|
-
tick?: RepositoryEvent
|
|
950
|
-
completed?: RepositoryEvent
|
|
951
|
-
boundary?: 'dispatcher.tick-started' | 'dispatcher.tick-completed' | 'dispatcher.tick-failed'
|
|
952
|
-
stopRequest?: Extract<RepositoryEvent, { type: 'dispatcher.stop-requested' }>
|
|
953
|
-
}
|
|
954
|
-
export function dispatcherRunFactsReducer(run: string) {
|
|
955
|
-
return defineReducer<DispatcherRunFacts, RepositoryEvent, DispatcherRunFacts>({
|
|
956
|
-
identity: 'dispatcherRunFacts',
|
|
957
|
-
initial: () => ({}),
|
|
958
|
-
fold(acc, events) {
|
|
959
|
-
for (const event of projectEvents(events)) {
|
|
960
|
-
if (!('run' in event.payload) || event.payload.run !== run) continue
|
|
961
|
-
foldDispatcherRunFact(acc, event)
|
|
962
|
-
}
|
|
963
|
-
},
|
|
964
|
-
finish: (acc) => structuredClone(acc),
|
|
965
|
-
})
|
|
966
|
-
}
|
|
967
|
-
|
|
968
|
-
function foldDispatcherRunFact(acc: DispatcherRunFacts, event: RepositoryEvent): void {
|
|
969
|
-
if (event.type === 'dispatcher.run-started') {
|
|
970
|
-
acc.start ??= event
|
|
971
|
-
acc.latestStart = event
|
|
972
|
-
} else if (event.type === 'dispatcher.runtime-recorded') acc.runtime = event
|
|
973
|
-
else if (event.type === 'dispatcher.run-stopped') acc.stop = event
|
|
974
|
-
else if (event.type === 'dispatcher.stop-requested') acc.stopRequest ??= event
|
|
975
|
-
else if (
|
|
976
|
-
event.type === 'dispatcher.tick-started' ||
|
|
977
|
-
event.type === 'dispatcher.tick-completed' ||
|
|
978
|
-
event.type === 'dispatcher.tick-failed'
|
|
979
|
-
) {
|
|
980
|
-
acc.boundary = event.type
|
|
981
|
-
if (event.type !== 'dispatcher.tick-started') acc.tick = event
|
|
982
|
-
if (event.type === 'dispatcher.tick-completed') acc.completed = event
|
|
983
|
-
}
|
|
984
|
-
}
|
|
617
|
+
repositoryReadFactsReducer,
|
|
618
|
+
optionalValue,
|
|
619
|
+
dispatcherRunFactsReducer,
|
|
620
|
+
type RepositoryReadAcc,
|
|
621
|
+
type DispatcherRunFacts,
|
|
622
|
+
} from './repository-read-facts'
|
|
@@ -22,16 +22,14 @@ import {
|
|
|
22
22
|
repositoryReadFactsReducer,
|
|
23
23
|
optionalValue,
|
|
24
24
|
} from './read-facts'
|
|
25
|
-
import { validateAccumulator, encodeReducerValue } from '../store/reducer-value-validation'
|
|
26
25
|
import {
|
|
27
26
|
effectiveConfigReducer,
|
|
28
27
|
buildDelegationReducer,
|
|
29
28
|
harvestDelegationReducer,
|
|
30
29
|
} from './service-facts'
|
|
31
|
-
import { phaseSchema } from '../ontology'
|
|
32
|
-
import { z } from 'zod'
|
|
33
30
|
import { dispatchPlacementReducer } from './dispatch-placement'
|
|
34
31
|
import type { ValueCatalogEntry } from '../store/reducer-values'
|
|
32
|
+
import { valueReadEntry, type RegisteredReducer } from './reducer-value-entry'
|
|
35
33
|
import { dispatchFrontendReducer } from '../cli/dispatch-repository-feed'
|
|
36
34
|
import { executionNoProgressReducer } from '../processes/execution-no-progress'
|
|
37
35
|
import { summaryBoundaryReducer, summaryRequestsReducer } from './pr-summary'
|
|
@@ -75,11 +73,11 @@ import { sessionReducer } from '../store/session-reducer'
|
|
|
75
73
|
import { pinnedAssetsReducer } from '../store/ticket-assets'
|
|
76
74
|
import { autoMergeDefaultReducer } from './auto-merge-default'
|
|
77
75
|
import { buildRosterEntryReducer, buildRosterRollup } from './build-roster'
|
|
76
|
+
import { doneEscalationEntryReducer, doneEscalationsRollup } from './done-escalations'
|
|
78
77
|
import { currentDeferralObservationReducer } from './auto-merge'
|
|
79
78
|
import { dispatchSettingsReducer } from './dispatch-settings'
|
|
80
79
|
import { dispatchStatusReducer } from './dispatch-status'
|
|
81
80
|
import { harvestReducer } from './harvest'
|
|
82
|
-
import type { IncrementalReducer } from './incremental'
|
|
83
81
|
import { logIndexReducer } from './log-index'
|
|
84
82
|
import {
|
|
85
83
|
currentPrAttachmentsReducer,
|
|
@@ -91,13 +89,7 @@ import { buildReducer } from './reducer'
|
|
|
91
89
|
import type { AnyRollupDefinition } from './rollup'
|
|
92
90
|
import { stepDurationsRollup } from './step-durations'
|
|
93
91
|
|
|
94
|
-
export
|
|
95
|
-
valueRead: ValueCatalogEntry | { excluded: string }
|
|
96
|
-
// biome-ignore lint/suspicious/noExplicitAny: the registry is heterogeneous
|
|
97
|
-
reducer: IncrementalReducer<any, any, any>
|
|
98
|
-
/** The whole-array functions (or private methods) this reducer backs. */
|
|
99
|
-
covers: readonly string[]
|
|
100
|
-
}
|
|
92
|
+
export type { RegisteredReducer } from './reducer-value-entry'
|
|
101
93
|
|
|
102
94
|
/** Parameterized reducers are registered with representative arguments; the
|
|
103
95
|
* accumulator shape does not depend on them. */
|
|
@@ -210,86 +202,23 @@ const REGISTERED: Record<string, Omit<RegisteredReducer, 'valueRead'>> = {
|
|
|
210
202
|
},
|
|
211
203
|
buildTimeline: { reducer: buildTimelineReducer, covers: [] },
|
|
212
204
|
buildRosterEntry: { reducer: buildRosterEntryReducer, covers: [] },
|
|
205
|
+
doneEscalationEntry: { reducer: doneEscalationEntryReducer, covers: [] },
|
|
213
206
|
autoMergeDefault: { reducer: autoMergeDefaultReducer, covers: ['latestAutoMergeDefault'] },
|
|
214
207
|
pinnedAssets: { reducer: pinnedAssetsReducer, covers: ['findPinnedRevision'] },
|
|
215
208
|
forgeHealthValue: { reducer: optionalValue(forgeHealthReducer), covers: [] },
|
|
216
209
|
dispatchPlacement: { reducer: dispatchPlacementReducer, covers: [] },
|
|
217
210
|
}
|
|
218
211
|
|
|
219
|
-
/**
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
[
|
|
230
|
-
'summaryBoundary',
|
|
231
|
-
'ticketSourceHealth',
|
|
232
|
-
'frozenPrImageHost',
|
|
233
|
-
'publishedBranchHead',
|
|
234
|
-
'verifyDiffBase',
|
|
235
|
-
'recordedBaseSha',
|
|
236
|
-
'baseBranch',
|
|
237
|
-
'provisionMarker',
|
|
238
|
-
'recoveryCheckpoint',
|
|
239
|
-
].map((name) => [name, 'finished contract can return top-level undefined, which is not JSON']),
|
|
240
|
-
),
|
|
241
|
-
}
|
|
242
|
-
const repositoryValues = new Set([
|
|
243
|
-
'dispatchPlacement',
|
|
244
|
-
'ticketPreparation',
|
|
245
|
-
'ticketHandbacks',
|
|
246
|
-
'ticketStarts',
|
|
247
|
-
'ticketMigrations',
|
|
248
|
-
'forgeHealthValue',
|
|
249
|
-
'repositoryReadFacts',
|
|
250
|
-
'dispatchUpgrade',
|
|
251
|
-
'dispatcherRunFacts',
|
|
252
|
-
'repositoryAttention',
|
|
253
|
-
'effectiveConfig',
|
|
254
|
-
'harvestDelegation',
|
|
255
|
-
'harvest',
|
|
256
|
-
'dispatchSettings',
|
|
257
|
-
'dispatchStatus',
|
|
258
|
-
'sandboxStates',
|
|
259
|
-
'openHarvestExecutions',
|
|
260
|
-
'hostedHarvestAuthority',
|
|
261
|
-
'openTick',
|
|
262
|
-
'autoMergeDefault',
|
|
263
|
-
])
|
|
264
|
-
const noArgs = z.object({}).strict()
|
|
265
|
-
const parameterized: Record<string, Pick<ValueCatalogEntry, 'args' | 'create'>> = {
|
|
266
|
-
terminalGuard: {
|
|
267
|
-
args: z
|
|
268
|
-
.object({ phase: phaseSchema, round: z.number().int(), session: z.string().min(1) })
|
|
269
|
-
.strict(),
|
|
270
|
-
create: (args) => terminalGuardReducer(args),
|
|
271
|
-
},
|
|
272
|
-
dispatchStatus: {
|
|
273
|
-
args: z.object({ run: z.string().min(1) }).strict(),
|
|
274
|
-
create: ({ run }) => dispatchStatusReducer(run),
|
|
275
|
-
},
|
|
276
|
-
dispatcherRunFacts: {
|
|
277
|
-
args: z.object({ run: z.string().min(1) }).strict(),
|
|
278
|
-
create: ({ run }) => dispatcherRunFactsReducer(run),
|
|
279
|
-
},
|
|
280
|
-
openTick: {
|
|
281
|
-
args: z.object({ run: z.string().min(1) }).strict(),
|
|
282
|
-
create: ({ run }) => openTickReducer(run),
|
|
283
|
-
},
|
|
284
|
-
dispatchFailureBudget: {
|
|
285
|
-
args: z.object({ infrastructureOwnsWorkspace: z.boolean() }).strict(),
|
|
286
|
-
create: ({ infrastructureOwnsWorkspace }) =>
|
|
287
|
-
dispatchFailureBudgetReducer(infrastructureOwnsWorkspace),
|
|
288
|
-
},
|
|
289
|
-
phaseFailures: {
|
|
290
|
-
args: z.object({ phase: phaseSchema, round: z.number().int().nonnegative() }).strict(),
|
|
291
|
-
create: ({ phase, round }) => phaseFailuresReducer(phase, round),
|
|
292
|
-
},
|
|
212
|
+
/** Constructors of the parameterized reducers; `parameterizedArgs` holds their
|
|
213
|
+
* argument schemas. */
|
|
214
|
+
const parameterizedCreate: Record<string, ValueCatalogEntry['create']> = {
|
|
215
|
+
terminalGuard: (args) => terminalGuardReducer(args),
|
|
216
|
+
dispatchStatus: ({ run }) => dispatchStatusReducer(run),
|
|
217
|
+
dispatcherRunFacts: ({ run }) => dispatcherRunFactsReducer(run),
|
|
218
|
+
openTick: ({ run }) => openTickReducer(run),
|
|
219
|
+
dispatchFailureBudget: ({ infrastructureOwnsWorkspace }) =>
|
|
220
|
+
dispatchFailureBudgetReducer(infrastructureOwnsWorkspace),
|
|
221
|
+
phaseFailures: ({ phase, round }) => phaseFailuresReducer(phase, round),
|
|
293
222
|
}
|
|
294
223
|
/** The node slugs one digest row names: a `build.created` target, or either
|
|
295
224
|
* side of a node parent move. Undecodable payloads name none. */
|
|
@@ -361,51 +290,39 @@ function digestTicketWaitOf(
|
|
|
361
290
|
return {}
|
|
362
291
|
}
|
|
363
292
|
|
|
293
|
+
/** The build digest folds compact rows rather than whole events. */
|
|
294
|
+
function adaptDigestRows(events: Parameters<ValueCatalogEntry['adapt']>[0]) {
|
|
295
|
+
return events.map((event) => ({
|
|
296
|
+
...(decodeStoredEvent(event) === null ? { rawUnknown: event } : {}),
|
|
297
|
+
type: event.type,
|
|
298
|
+
seq: event.seq,
|
|
299
|
+
ts: event.ts,
|
|
300
|
+
...(event.payload !== null && typeof event.payload === 'object' && 'hostedSeq' in event.payload
|
|
301
|
+
? { hostedSeq: event.payload.hostedSeq }
|
|
302
|
+
: {}),
|
|
303
|
+
...(event.type === 'integration.landed' ? { auditRequested: !!event.payload.operation } : {}),
|
|
304
|
+
...(event.type === 'pr.merged' ? { mergedSha: event.payload.sha } : {}),
|
|
305
|
+
...(event.type === 'node.contribution-recorded' ? { nodeContribution: event.payload } : {}),
|
|
306
|
+
...(event.type === 'build.created' ? { kind: event.payload.kind } : {}),
|
|
307
|
+
...digestNodeTargetsOf(event),
|
|
308
|
+
...(event.payload !== null && typeof event.payload === 'object' && 'instance' in event.payload
|
|
309
|
+
? { instance: event.payload.instance }
|
|
310
|
+
: {}),
|
|
311
|
+
...digestTicketWaitOf(event),
|
|
312
|
+
...digestAttemptOf(event),
|
|
313
|
+
...digestOptimizationOf(event),
|
|
314
|
+
}))
|
|
315
|
+
}
|
|
316
|
+
|
|
364
317
|
export const REDUCERS: Record<string, RegisteredReducer> = Object.fromEntries(
|
|
365
318
|
Object.entries(REGISTERED).map(([name, entry]) => [
|
|
366
319
|
name,
|
|
367
320
|
{
|
|
368
321
|
...entry,
|
|
369
|
-
valueRead:
|
|
370
|
-
? {
|
|
371
|
-
: {
|
|
372
|
-
|
|
373
|
-
args: parameterized[name]?.args ?? noArgs,
|
|
374
|
-
validate: (state: unknown) => validateAccumulator(name, state),
|
|
375
|
-
value: encodeReducerValue,
|
|
376
|
-
adapt: (events: Parameters<ValueCatalogEntry['adapt']>[0]) =>
|
|
377
|
-
name === 'buildDigest'
|
|
378
|
-
? events.map((event) => ({
|
|
379
|
-
...(decodeStoredEvent(event) === null ? { rawUnknown: event } : {}),
|
|
380
|
-
type: event.type,
|
|
381
|
-
seq: event.seq,
|
|
382
|
-
ts: event.ts,
|
|
383
|
-
...(event.payload !== null &&
|
|
384
|
-
typeof event.payload === 'object' &&
|
|
385
|
-
'hostedSeq' in event.payload
|
|
386
|
-
? { hostedSeq: event.payload.hostedSeq }
|
|
387
|
-
: {}),
|
|
388
|
-
...(event.type === 'integration.landed'
|
|
389
|
-
? { auditRequested: !!event.payload.operation }
|
|
390
|
-
: {}),
|
|
391
|
-
...(event.type === 'pr.merged' ? { mergedSha: event.payload.sha } : {}),
|
|
392
|
-
...(event.type === 'node.contribution-recorded'
|
|
393
|
-
? { nodeContribution: event.payload }
|
|
394
|
-
: {}),
|
|
395
|
-
...(event.type === 'build.created' ? { kind: event.payload.kind } : {}),
|
|
396
|
-
...digestNodeTargetsOf(event),
|
|
397
|
-
...(event.payload !== null &&
|
|
398
|
-
typeof event.payload === 'object' &&
|
|
399
|
-
'instance' in event.payload
|
|
400
|
-
? { instance: event.payload.instance }
|
|
401
|
-
: {}),
|
|
402
|
-
...digestTicketWaitOf(event),
|
|
403
|
-
...digestAttemptOf(event),
|
|
404
|
-
...digestOptimizationOf(event),
|
|
405
|
-
}))
|
|
406
|
-
: events,
|
|
407
|
-
create: parameterized[name]?.create ?? (() => entry.reducer),
|
|
408
|
-
},
|
|
322
|
+
valueRead: valueReadEntry(name, entry.reducer, {
|
|
323
|
+
...(parameterizedCreate[name] ? { create: parameterizedCreate[name] } : {}),
|
|
324
|
+
...(name === 'buildDigest' ? { adapt: adaptDigestRows } : {}),
|
|
325
|
+
}),
|
|
409
326
|
},
|
|
410
327
|
]),
|
|
411
328
|
)
|
|
@@ -417,6 +334,7 @@ export const REDUCERS: Record<string, RegisteredReducer> = Object.fromEntries(
|
|
|
417
334
|
export const ROLLUPS: Record<string, AnyRollupDefinition> = {
|
|
418
335
|
stepDurations: stepDurationsRollup,
|
|
419
336
|
buildRoster: buildRosterRollup,
|
|
337
|
+
doneEscalations: doneEscalationsRollup,
|
|
420
338
|
}
|
|
421
339
|
|
|
422
340
|
/** Event-array functions that are deliberately not reducers, each with the
|
|
@@ -74,4 +74,22 @@ export const REDUCER_REVISIONS: Readonly<Record<string, string>> = {
|
|
|
74
74
|
'verifyDiffBase/fold/p2si2x55v7': '#1274 rewritten-target reprovision, accept waiver, episodes',
|
|
75
75
|
'repositoryReadFacts/shape/mggr8x6l5z': '#1279 reported dispatcher run tracks pending runs',
|
|
76
76
|
'repositoryReadFacts/fold/vvcfmd23zp': '#1279 status describes the authority run',
|
|
77
|
+
'build/shape/rclfl10h8j': 'Durable slot admission and release seqs (SPEC §12 What holds a slot)',
|
|
78
|
+
'build/shape/i4uoqi67lx': 'Node slot admission names its need (#1340)',
|
|
79
|
+
'build/fold/4hkypq2buv': '#1348 answers release a slot only when the build was not carried',
|
|
80
|
+
'build/shape/h19l48la2y': '#1359 clean-restack verify policy and boundary',
|
|
81
|
+
'leafRestack/shape/k7h2nawq9o': '#1359 clean-restack verify policy and boundary',
|
|
82
|
+
'logIndex/shape/e562ii8zcc': '#1359 clean-restack verify policy and boundary',
|
|
83
|
+
'publicationState/shape/6hw8qpns3s': '#1359 clean-restack verify policy and boundary',
|
|
84
|
+
'build/fold/rn0n0mihd9': '#1359 clean-restack re-verification boundary',
|
|
85
|
+
'logIndex/fold/3yvjztpvdb': '#1359 clean-restack re-verification boundary',
|
|
86
|
+
'repositoryAttention/fold/u6bhzf2af0': '#1357 tick-failure episodes span one-tick runs',
|
|
87
|
+
'repositoryReadFacts/fold/4gnmhbji3n': '#1357 tick-failure episodes span one-tick runs',
|
|
88
|
+
'build/shape/dtklvw6hfs': '#1354 four-level build and start priority',
|
|
89
|
+
'ticketStarts/shape/dzxrbuuq7e': '#1354 four-level build and start priority',
|
|
90
|
+
'repositoryReadFacts/shape/5yo149tiqz': '#1354 four-level build and start priority',
|
|
91
|
+
'build/fold/zdrl0ibew9': '#1354 high and low levels refine build and start priority',
|
|
92
|
+
'ticketStarts/fold/8fp156vze2': '#1354 high and low levels refine build and start priority',
|
|
93
|
+
'doneEscalationEntry/shape/4d674ku017': 'Track outcome; abort cleanup is never listed',
|
|
94
|
+
'doneEscalationEntry/shape/j7xarl33s3': 'Drop outcome; completion closes nothing',
|
|
77
95
|
}
|