@defrex/autobuild 1.0.1 → 1.2.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 +10 -18
- package/SPEC.md +499 -238
- package/bin/ab-dispatch-generation.ts +11 -2
- package/docs/accounts.md +119 -0
- package/docs/agent-runtimes.md +4 -4
- package/docs/answering-blocked-builds.md +2 -2
- package/docs/architecture.md +262 -53
- package/docs/assets/headline-wide.png +0 -0
- package/docs/build-store.md +3 -41
- package/docs/builds.md +4 -4
- package/docs/cli.md +18 -4
- package/docs/configuration-overview.md +115 -4
- package/docs/configuration.md +488 -334
- package/docs/dispatcher-hosting.md +19 -34
- 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/intake.md +2 -0
- package/docs/integration-overview.md +15 -15
- package/docs/integration-tree.md +45 -38
- package/docs/integration.md +6 -6
- package/{skills/guide/references/landing-policy.md → docs/merge-policy.md} +40 -24
- package/docs/migration-1.0.md +17 -13
- package/docs/operating.md +41 -19
- package/docs/operator-api.md +180 -51
- package/docs/operator-surfaces.md +5 -18
- package/docs/overview.md +3 -3
- package/docs/plugin-authoring.md +21 -0
- package/docs/remote-store-protocol.md +242 -68
- package/docs/remote-ticket-protocol.md +30 -50
- package/docs/restacking.md +54 -15
- package/docs/seams.md +8 -8
- package/docs/setup.md +59 -119
- package/docs/skills.md +1 -1
- package/docs/spec-standard.md +6 -6
- package/docs/ticket-dependencies.md +7 -7
- package/docs/ticket-sources.md +18 -0
- package/docs/tickets.md +8 -2
- package/docs/troubleshooting.md +8 -12
- package/docs/upgrading.md +9 -4
- package/docs/verification.md +60 -14
- package/docs/workspaces.md +4 -4
- package/package.json +17 -6
- package/packages/core/src/accounts/chatgpt-oauth.ts +216 -0
- package/packages/core/src/accounts/chatgpt-state.ts +41 -0
- package/packages/core/src/accounts/local-credentials.ts +194 -0
- package/packages/core/src/accounts/local-inference.ts +106 -0
- package/packages/core/src/accounts/local-owner.ts +123 -0
- package/packages/core/src/accounts/sensitive.ts +2 -0
- package/packages/core/src/cli/accounts.ts +147 -0
- 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/binary.ts +3 -1
- package/packages/core/src/cli/build-control.ts +83 -28
- package/packages/core/src/cli/connect.ts +3 -3
- 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-handoff.ts +125 -44
- package/packages/core/src/cli/dispatch-launch-contract.ts +187 -0
- package/packages/core/src/cli/dispatch-launcher.ts +54 -21
- package/packages/core/src/cli/dispatch-preflight.ts +6 -1
- package/packages/core/src/cli/dispatch.ts +106 -11
- package/packages/core/src/cli/env.ts +4 -0
- package/packages/core/src/cli/help.ts +46 -23
- package/packages/core/src/cli/init-readiness-remote.ts +22 -1
- package/packages/core/src/cli/init-readiness-shared.ts +5 -1
- package/packages/core/src/cli/init-validation.ts +160 -18
- package/packages/core/src/cli/main.ts +68 -8
- package/packages/core/src/cli/node-verification-provenance.ts +1 -97
- package/packages/core/src/cli/publication-settlement.ts +47 -21
- package/packages/core/src/cli/repository-status.ts +20 -9
- package/packages/core/src/cli/secrets.ts +173 -0
- package/packages/core/src/cli/status.ts +42 -5
- package/packages/core/src/cli/store-opening.ts +17 -2
- package/packages/core/src/cli/terminal.ts +22 -1
- package/packages/core/src/cli/terminals.ts +14 -10
- package/packages/core/src/cli/upgrade-agent.ts +9 -1
- 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 +635 -510
- package/packages/core/src/config/accounts.ts +101 -0
- 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/live.ts +14 -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/roles.ts +54 -3
- package/packages/core/src/config/schema.ts +146 -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/compatibility.ts +2 -1
- package/packages/core/src/events/globs.ts +1 -1
- package/packages/core/src/events/payloads.ts +73 -1
- package/packages/core/src/events/policy.ts +7 -0
- package/packages/core/src/events/repository.ts +4 -4
- package/packages/core/src/events/sessions.ts +6 -6
- package/packages/core/src/kernel/__snapshots__/reducer-accumulator-shapes.json +574 -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 +85 -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 +3 -7
- package/packages/core/src/operator/landings.ts +5 -1
- package/packages/core/src/operator/presentation.ts +6 -1
- package/packages/core/src/operator/protocol.ts +6 -0
- package/packages/core/src/operator/query.ts +14 -18
- package/packages/core/src/operator/registry.ts +39 -7
- 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/operator/tickets.ts +25 -4
- package/packages/core/src/plugins/manifest.ts +2 -1
- 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/runner/account-env.ts +88 -0
- package/packages/core/src/ports/runner/chatgpt-provider.ts +85 -0
- package/packages/core/src/ports/runner/claude.ts +26 -2
- package/packages/core/src/ports/runner/codex.ts +63 -31
- package/packages/core/src/ports/runner/one-shot.ts +2 -0
- package/packages/core/src/ports/runner/provider-error.ts +5 -0
- package/packages/core/src/ports/runner/routing.ts +35 -4
- package/packages/core/src/ports/tickets/contract.ts +58 -0
- package/packages/core/src/ports/tickets/tree.ts +1 -1
- package/packages/core/src/ports/types.ts +28 -7
- package/packages/core/src/ports/workspace/account-policy.ts +72 -0
- package/packages/core/src/ports/workspace/build-execution.ts +9 -2
- package/packages/core/src/ports/workspace/builtin-capabilities.ts +1 -0
- package/packages/core/src/ports/workspace/create.ts +2 -0
- package/packages/core/src/ports/workspace/git-worktree.ts +6 -1
- package/packages/core/src/ports/workspace/phase-scratch.ts +4 -3
- package/packages/core/src/ports/workspace/provider-capabilities.ts +1 -0
- package/packages/core/src/ports/workspace/vercel-sandbox.ts +182 -72
- 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 +554 -99
- package/packages/core/src/processes/dispatcher.ts +209 -101
- package/packages/core/src/processes/execution-no-progress.ts +8 -1
- package/packages/core/src/processes/execution-settlement.ts +21 -3
- package/packages/core/src/processes/harvest-runner.ts +68 -8
- 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/project-secrets.ts +105 -0
- package/packages/core/src/{integration → scenarios}/harness.ts +330 -317
- package/packages/core/src/secret-name.ts +41 -0
- package/packages/core/src/store/account-redaction.ts +156 -0
- 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 +116 -2
- 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 +5185 -4156
- package/packages/core/src/store/remote/client.ts +89 -48
- package/packages/core/src/store/remote/compatibility.ts +20 -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/dispatch-read-budget.ts +122 -0
- package/packages/core/src/testing/index.ts +12 -1
- package/packages/core/src/testing/reduced-read-budget.ts +47 -0
- 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 +373 -148
- package/skills/guide/references/accounts.md +119 -0
- package/skills/guide/references/integration-tree.md +45 -38
- package/{docs/landing-policy.md → skills/guide/references/merge-policy.md} +40 -24
- package/skills/guide/references/migration-1.0.md +17 -13
- package/skills/guide/references/operator-api.md +180 -51
- package/skills/guide/references/plugin-authoring.md +21 -0
- package/skills/guide/references/remote-store-protocol.md +242 -68
- package/skills/guide/references/remote-ticket-protocol.md +30 -50
- package/skills/guide/references/restacking.md +54 -15
- package/skills/guide/references/setup.md +59 -119
- package/skills/guide/references/spec-standard.md +6 -6
- package/skills/guide/references/ticket-dependencies.md +7 -7
- package/skills/harvest/SKILL.md +3 -1
- package/skills/harvest-review/SKILL.md +3 -1
- package/skills/implement/SKILL.md +43 -17
- package/skills/operate/SKILL.md +118 -118
- 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 +20 -20
- package/skills/tickets/SKILL.md +12 -9
- package/templates/autobuild.toml +1 -1
- package/templates/hosted-service/package.json +2 -2
- package/docs/hosted-dispatcher-cutover-validation.md +0 -178
- package/docs/hosted-dispatcher.md +0 -275
- package/docs/hosted-service.md +0 -293
- package/docs/mcp.md +0 -149
- 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
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { selectedAccountSchema } from '../config/accounts'
|
|
1
2
|
import { runtimeIdentitySchema } from './runtime'
|
|
2
3
|
import { viaSchema } from './envelope'
|
|
3
4
|
import { nativeSessionHandleSchema } from './native-session'
|
|
@@ -141,6 +142,7 @@ export const agentFailureCauseSchema = z.enum([
|
|
|
141
142
|
|
|
142
143
|
/** One configured execution target that failed within a single phase attempt. */
|
|
143
144
|
export const providerAttemptSchema = z.strictObject({
|
|
145
|
+
account: selectedAccountSchema.optional(),
|
|
144
146
|
index: z.number().int().nonnegative(),
|
|
145
147
|
session: z.string().min(1),
|
|
146
148
|
runner: z.string().min(1),
|
|
@@ -470,6 +472,12 @@ export const eventPayloadSchemas = {
|
|
|
470
472
|
id: z.string().min(1),
|
|
471
473
|
head: z.string().min(1),
|
|
472
474
|
parent: z.string().min(1),
|
|
475
|
+
context: z
|
|
476
|
+
.strictObject({
|
|
477
|
+
kind: z.literal('node-verification-context'),
|
|
478
|
+
rev: z.number().int().nonnegative(),
|
|
479
|
+
})
|
|
480
|
+
.optional(),
|
|
473
481
|
config: z.string().min(1),
|
|
474
482
|
}),
|
|
475
483
|
'integration.landing-intended': z
|
|
@@ -485,7 +493,7 @@ export const eventPayloadSchemas = {
|
|
|
485
493
|
})
|
|
486
494
|
.refine(
|
|
487
495
|
(value) => value.commandSeq !== undefined || value.decisionSeq !== undefined,
|
|
488
|
-
'
|
|
496
|
+
'merge intent requires decisionSeq or legacy commandSeq',
|
|
489
497
|
),
|
|
490
498
|
'integration.landed': z.strictObject({
|
|
491
499
|
operation: z.string().optional(),
|
|
@@ -657,6 +665,23 @@ export const eventPayloadSchemas = {
|
|
|
657
665
|
disposition: z.enum(['attempted', 'skipped', 'deferred']),
|
|
658
666
|
}),
|
|
659
667
|
'finalize.step-started': z.strictObject({ step: z.string().min(1) }),
|
|
668
|
+
'publication.retry-scheduled': z.strictObject({
|
|
669
|
+
operation: z.enum(['restack', 'reconcile']),
|
|
670
|
+
rewriteId: z.string().min(1),
|
|
671
|
+
round: round,
|
|
672
|
+
anchor: z.number().int().nonnegative(),
|
|
673
|
+
failure: z.number().int().min(1).max(6),
|
|
674
|
+
error: z.string().min(1),
|
|
675
|
+
retryAt: z.iso.datetime(),
|
|
676
|
+
}),
|
|
677
|
+
'publication.retry-exhausted': z.strictObject({
|
|
678
|
+
operation: z.enum(['restack', 'reconcile']),
|
|
679
|
+
rewriteId: z.string().min(1),
|
|
680
|
+
round: round,
|
|
681
|
+
anchor: z.number().int().nonnegative(),
|
|
682
|
+
failure: z.literal(7),
|
|
683
|
+
error: z.string().min(1),
|
|
684
|
+
}),
|
|
660
685
|
/** Remote phases deposit their output and park before trusted publication.
|
|
661
686
|
* The dispatcher settles the request only after the VM session and execution
|
|
662
687
|
* lease are gone, then appends the ordinary phase completion fact. */
|
|
@@ -823,6 +848,7 @@ export const eventPayloadSchemas = {
|
|
|
823
848
|
model: z.string().optional(),
|
|
824
849
|
/** Optional only so historical events replay without migration. */
|
|
825
850
|
args: z.array(z.string()).optional(),
|
|
851
|
+
account: selectedAccountSchema.optional(),
|
|
826
852
|
phase: phaseSchema,
|
|
827
853
|
round: round.optional(),
|
|
828
854
|
/** Stream id this session's live view writes to (SPEC §9, session
|
|
@@ -912,6 +938,7 @@ export const eventPayloadSchemas = {
|
|
|
912
938
|
'plan-review.verdict': reviewVerdictPayload,
|
|
913
939
|
'implement.started': z.strictObject({
|
|
914
940
|
round,
|
|
941
|
+
verifyStageFailure: z.number().int().positive().optional(),
|
|
915
942
|
/** Carries routed feedback for this producer occurrence. Guidance remains
|
|
916
943
|
* recoverable until a matching `session.started` records launch. */
|
|
917
944
|
feedback: feedbackSchema.optional(),
|
|
@@ -925,6 +952,21 @@ export const eventPayloadSchemas = {
|
|
|
925
952
|
'code-review.verdict': reviewVerdictPayload,
|
|
926
953
|
|
|
927
954
|
// ── Verify / finalize ──────────────────────────────────────────────────────
|
|
955
|
+
'verify.config-captured': z.strictObject({
|
|
956
|
+
cycle: z.number().int().nonnegative(),
|
|
957
|
+
artifact: artifactRefSchema,
|
|
958
|
+
head: gitOid,
|
|
959
|
+
identity: z.string().min(1),
|
|
960
|
+
source: z.strictObject({
|
|
961
|
+
ref: z.enum(['branch-head', 'worktree-dirty']),
|
|
962
|
+
commit: gitOid.optional(),
|
|
963
|
+
}),
|
|
964
|
+
}),
|
|
965
|
+
'verify.config-superseded': z.strictObject({
|
|
966
|
+
captureSeq: z.number().int().positive(),
|
|
967
|
+
head: gitOid,
|
|
968
|
+
identity: z.string().min(1),
|
|
969
|
+
}),
|
|
928
970
|
'verify.started': z.strictObject({
|
|
929
971
|
baseSha: gitOid.optional(),
|
|
930
972
|
headSha: gitOid.optional(),
|
|
@@ -939,6 +981,7 @@ export const eventPayloadSchemas = {
|
|
|
939
981
|
feedback: feedbackSchema.optional(),
|
|
940
982
|
}),
|
|
941
983
|
'verify.reconcile-policy-captured': z.strictObject({
|
|
984
|
+
cycle: z.number().int().nonnegative().optional(),
|
|
942
985
|
reconcileSeq: z.number().int().positive(),
|
|
943
986
|
steps: z
|
|
944
987
|
.array(
|
|
@@ -960,6 +1003,27 @@ export const eventPayloadSchemas = {
|
|
|
960
1003
|
}),
|
|
961
1004
|
}),
|
|
962
1005
|
'verify.completed': verifyCompletedPayloadSchema,
|
|
1006
|
+
'verify.cancelled': z.strictObject({
|
|
1007
|
+
...verifyCompletionBase,
|
|
1008
|
+
cause: z.strictObject({ step: z.string().min(1) }),
|
|
1009
|
+
}),
|
|
1010
|
+
'verify.stage-failed': z.strictObject({
|
|
1011
|
+
attempt,
|
|
1012
|
+
cycle: z.number().int().nonnegative(),
|
|
1013
|
+
stage: z.array(z.string().min(1)).min(1),
|
|
1014
|
+
baseSha: gitOid.optional(),
|
|
1015
|
+
headSha: gitOid.optional(),
|
|
1016
|
+
restackId: z.string().min(1).optional(),
|
|
1017
|
+
failed: z.array(
|
|
1018
|
+
z.strictObject({ step: z.string().min(1), report: artifactRefSchema.optional() }),
|
|
1019
|
+
),
|
|
1020
|
+
cancelled: z.array(
|
|
1021
|
+
z.strictObject({
|
|
1022
|
+
step: z.string().min(1),
|
|
1023
|
+
cause: z.strictObject({ step: z.string().min(1) }),
|
|
1024
|
+
}),
|
|
1025
|
+
),
|
|
1026
|
+
}),
|
|
963
1027
|
'finalize.started': empty,
|
|
964
1028
|
'finalize.completed': z.strictObject({
|
|
965
1029
|
pr: z.strictObject({
|
|
@@ -1015,6 +1079,14 @@ export const eventPayloadSchemas = {
|
|
|
1015
1079
|
attempt,
|
|
1016
1080
|
baseSha: z.string().min(1),
|
|
1017
1081
|
}),
|
|
1082
|
+
'target.distance': z
|
|
1083
|
+
.strictObject({
|
|
1084
|
+
branch: z.string().min(1),
|
|
1085
|
+
sha: gitOid,
|
|
1086
|
+
head: gitOid.nullable(),
|
|
1087
|
+
count: z.number().int().nonnegative().nullable(),
|
|
1088
|
+
})
|
|
1089
|
+
.refine((sample) => sample.count === null || sample.head !== null),
|
|
1018
1090
|
'target.moved': z.strictObject({ branch: z.string().min(1), sha: gitOid }),
|
|
1019
1091
|
'restack.prepared': leafRestackSchema,
|
|
1020
1092
|
'restack.replayed': z.strictObject({
|
|
@@ -22,6 +22,7 @@ export const buildEventPolicy = {
|
|
|
22
22
|
'landing.native-enable-started': 'decisive',
|
|
23
23
|
'landing.forge-merged': 'decisive',
|
|
24
24
|
'landing.native-applied': 'decisive',
|
|
25
|
+
'target.distance': 'advisory',
|
|
25
26
|
'target.moved': 'decisive',
|
|
26
27
|
'restack.prepared': 'decisive',
|
|
27
28
|
'restack.replayed': 'decisive',
|
|
@@ -82,6 +83,8 @@ export const buildEventPolicy = {
|
|
|
82
83
|
'finalize.step-started': 'decisive',
|
|
83
84
|
'publication.requested': 'decisive',
|
|
84
85
|
'publication.lost': 'decisive',
|
|
86
|
+
'publication.retry-scheduled': 'decisive',
|
|
87
|
+
'publication.retry-exhausted': 'decisive',
|
|
85
88
|
'abort.remote-branch-deleted': 'decisive',
|
|
86
89
|
'abort.local-branch-deleted': 'decisive',
|
|
87
90
|
'abort.ticket-returned': 'decisive',
|
|
@@ -115,7 +118,11 @@ export const buildEventPolicy = {
|
|
|
115
118
|
'code-review.started': 'decisive',
|
|
116
119
|
'code-review.verdict': 'decisive',
|
|
117
120
|
'verify.reconcile-policy-captured': 'decisive',
|
|
121
|
+
'verify.config-captured': 'decisive',
|
|
122
|
+
'verify.config-superseded': 'decisive',
|
|
118
123
|
'verify.started': 'decisive',
|
|
124
|
+
'verify.cancelled': 'decisive',
|
|
125
|
+
'verify.stage-failed': 'decisive',
|
|
119
126
|
'verify.completed': 'decisive',
|
|
120
127
|
'finalize.started': 'decisive',
|
|
121
128
|
'finalize.completed': 'decisive',
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { selectedAccountSchema } from '../config/accounts'
|
|
1
2
|
import { nativeSessionHandleSchema } from './native-session'
|
|
2
3
|
import { runtimeIdentitySchema } from './runtime'
|
|
3
4
|
import { stampCompatibility, type CompatibilityMetadata, repositoryEventPolicy } from './policy'
|
|
@@ -84,9 +85,7 @@ const tickCountersSchema = z.strictObject({
|
|
|
84
85
|
sandboxIdleStops: z.number().int().nonnegative().optional(),
|
|
85
86
|
/** Contained idle-settlement failures this tick; retried next tick. */
|
|
86
87
|
sandboxSettleFailures: z.number().int().nonnegative().optional(),
|
|
87
|
-
/**
|
|
88
|
-
* every tick until the config is repaired. Optional so historical tick
|
|
89
|
-
* facts replay. */
|
|
88
|
+
/** Historical embedded-runner counter, retained for strict event replay. */
|
|
90
89
|
orchestratorSandboxFailures: z.number().int().nonnegative().optional(),
|
|
91
90
|
harvestStarted: z.number().int().nonnegative(),
|
|
92
91
|
harvestResumed: z.number().int().nonnegative(),
|
|
@@ -280,6 +279,7 @@ export const harvestEventPayloadSchemas = {
|
|
|
280
279
|
model: z.string().optional(),
|
|
281
280
|
/** Optional only so historical repository journals replay without migration. */
|
|
282
281
|
args: z.array(z.string()).optional(),
|
|
282
|
+
account: selectedAccountSchema.optional(),
|
|
283
283
|
step: z.enum(['synthesize', 'review']),
|
|
284
284
|
round,
|
|
285
285
|
/** Stream id this session's live view writes to (SPEC §9, session
|
|
@@ -743,7 +743,7 @@ export const REPOSITORY_EVENT_TYPES = Object.keys(
|
|
|
743
743
|
) as RepositoryEventType[]
|
|
744
744
|
|
|
745
745
|
/** Repository attention followed by `ab watch` with no slugs or explicit
|
|
746
|
-
* `--repository
|
|
746
|
+
* `--repository`. Historical session wakes also used this catalog. */
|
|
747
747
|
export const REPOSITORY_ATTENTION_EVENTS = [
|
|
748
748
|
'harvest.escalated',
|
|
749
749
|
'harvest.failed',
|
|
@@ -58,7 +58,7 @@ const turnTriggerSchema = z.discriminatedUnion('kind', [
|
|
|
58
58
|
])
|
|
59
59
|
|
|
60
60
|
/** Matches the transcript usage shape (harvest.session.ended, §15.3). The
|
|
61
|
-
*
|
|
61
|
+
* historical runner recorded the AI SDK's totalUsage token counts plus the step
|
|
62
62
|
* count. Old `turn.completed` events without `steps` still reduce. */
|
|
63
63
|
const usageSchema = z.strictObject({
|
|
64
64
|
inputTokens: z.number().int().nonnegative(),
|
|
@@ -85,12 +85,12 @@ export const sessionEventPayloadSchemas = {
|
|
|
85
85
|
'session.created': z.strictObject({ title: z.string().min(1).optional() }),
|
|
86
86
|
/** A human operator's message. */
|
|
87
87
|
'message.posted': z.strictObject({ text: z.string().min(1) }),
|
|
88
|
-
/**
|
|
89
|
-
*
|
|
88
|
+
/** Explicit durable wake settings. Historical execution used these filters;
|
|
89
|
+
* current writes never start turns. */
|
|
90
90
|
'session.wake-set': z.strictObject({
|
|
91
91
|
globs: z.array(z.string().min(1)).max(100),
|
|
92
92
|
}),
|
|
93
|
-
/** The
|
|
93
|
+
/** The historical start of one turn on its stream. A wake
|
|
94
94
|
* turn additionally carries the delivered input — the attention event
|
|
95
95
|
* record and, for a build wake, the build's reduced state, frozen at wake
|
|
96
96
|
* time — so a later invocation reconstructs the identical user message
|
|
@@ -172,8 +172,8 @@ export interface SessionEventWrite<T extends SessionEventType = SessionEventType
|
|
|
172
172
|
|
|
173
173
|
/** Which actor kinds may emit each event type — the session catalog's Actor
|
|
174
174
|
* column, enforced at validation exactly as for builds (§15.3). Humans create,
|
|
175
|
-
* message, configure wakes, answer approvals, and archive;
|
|
176
|
-
*
|
|
175
|
+
* message, configure wakes, answer approvals, and archive; historical turn
|
|
176
|
+
* lifecycle facts retain their agent attribution. */
|
|
177
177
|
const allowedActorKinds: Record<SessionEventType, readonly ActorKind[]> = {
|
|
178
178
|
'session.created': ['human'],
|
|
179
179
|
'message.posted': ['human'],
|