@defrex/autobuild 1.0.0-beta.1 → 1.0.0-beta.3
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/SPEC.md +310 -56
- package/bin/ab-build-runner.ts +10 -8
- package/docs/architecture.md +177 -23
- package/docs/configuration.md +35 -4
- package/docs/hosted-service.md +35 -0
- package/docs/integration-tree.md +83 -4
- package/docs/landing-policy.md +11 -0
- package/docs/migration-1.0.md +9 -0
- package/docs/operator-api.md +18 -0
- package/docs/remote-store-protocol.md +16 -0
- package/docs/remote-ticket-protocol.md +5 -0
- package/docs/restacking.md +42 -7
- package/docs/setup.md +25 -0
- package/docs/spec-standard.md +71 -0
- package/docs/ticket-dependencies.md +6 -45
- package/docs/ticket-migration.md +50 -4
- package/package.json +3 -3
- package/packages/core/src/cli/attention.ts +4 -1
- package/packages/core/src/cli/binary.ts +17 -1
- package/packages/core/src/cli/build-control.ts +3 -3
- package/packages/core/src/cli/context.ts +53 -1
- package/packages/core/src/cli/dashboard/actions.ts +4 -0
- package/packages/core/src/cli/dashboard/detail.ts +45 -1
- package/packages/core/src/cli/dashboard/facts.ts +7 -2
- package/packages/core/src/cli/dashboard/integration-detail.ts +144 -0
- package/packages/core/src/cli/dashboard/integration-row.ts +255 -0
- package/packages/core/src/cli/dashboard/landing-display.ts +64 -0
- package/packages/core/src/cli/dashboard/model.ts +147 -16
- package/packages/core/src/cli/dashboard/poll.ts +40 -4
- package/packages/core/src/cli/dashboard/render.ts +106 -5
- package/packages/core/src/cli/dashboard/transcript.ts +2 -1
- package/packages/core/src/cli/dispatch-frontend.ts +11 -0
- package/packages/core/src/cli/dispatch-repository-feed.ts +2 -1
- package/packages/core/src/cli/dispatch.ts +49 -14
- package/packages/core/src/cli/help.ts +17 -1
- package/packages/core/src/cli/main.ts +48 -8
- package/packages/core/src/cli/publication-settlement.ts +49 -5
- package/packages/core/src/cli/repository-status.ts +103 -2
- package/packages/core/src/cli/status.ts +24 -1
- package/packages/core/src/cli/terminals.ts +94 -93
- package/packages/core/src/cli/ticket.ts +35 -11
- package/packages/core/src/cli/wait.ts +11 -2
- package/packages/core/src/cli/watch.ts +12 -0
- package/packages/core/src/config/schema.ts +3 -0
- package/packages/core/src/events/catalog.ts +38 -0
- package/packages/core/src/events/compatibility.ts +183 -0
- package/packages/core/src/events/native-session.ts +13 -0
- package/packages/core/src/events/payloads.ts +150 -2
- package/packages/core/src/events/policy.ts +210 -0
- package/packages/core/src/events/repository.ts +69 -0
- package/packages/core/src/integration/harness.ts +4 -4
- package/packages/core/src/kernel/__snapshots__/{reducer-registry.test.ts.snap → reducer-accumulator-shapes.json} +4286 -4006
- package/packages/core/src/kernel/change-presence.ts +11 -3
- package/packages/core/src/kernel/dispatch-capacity.ts +127 -0
- package/packages/core/src/kernel/dispatcher-liveness.ts +5 -1
- package/packages/core/src/kernel/engine.ts +25 -5
- package/packages/core/src/kernel/forge-health.ts +19 -0
- package/packages/core/src/kernel/generators/build-log.ts +18 -0
- package/packages/core/src/kernel/generators/node-restack-log.ts +1 -1
- package/packages/core/src/kernel/generators/repository-journals.ts +10 -0
- package/packages/core/src/kernel/guarded-forge.ts +159 -0
- package/packages/core/src/kernel/incremental.ts +4 -2
- package/packages/core/src/kernel/integration-completeness.ts +108 -9
- package/packages/core/src/kernel/integration-landing.ts +5 -4
- package/packages/core/src/kernel/janitor-failure.ts +36 -0
- package/packages/core/src/kernel/landing-publication.ts +35 -15
- package/packages/core/src/kernel/landing-state.ts +7 -0
- package/packages/core/src/kernel/leaf-restack-state.ts +1 -1
- package/packages/core/src/kernel/log-index.ts +12 -1
- package/packages/core/src/kernel/mixed-version.ts +52 -0
- package/packages/core/src/kernel/node-landing.ts +14 -11
- package/packages/core/src/kernel/node-parent.ts +35 -10
- package/packages/core/src/kernel/node-restack-demand.ts +29 -0
- package/packages/core/src/kernel/node-restack-state.ts +46 -16
- package/packages/core/src/kernel/node-restack-transaction.ts +151 -8
- package/packages/core/src/kernel/node-restack.ts +34 -10
- package/packages/core/src/kernel/publication.ts +22 -0
- package/packages/core/src/kernel/read-deferrals.ts +111 -0
- package/packages/core/src/kernel/read-facts.ts +34 -6
- package/packages/core/src/kernel/reconcile-restack.ts +23 -2
- package/packages/core/src/kernel/reducer-registry.ts +18 -2
- package/packages/core/src/kernel/reducer.ts +196 -10
- package/packages/core/src/kernel/repository-attention.ts +38 -1
- package/packages/core/src/kernel/terminal-guard.ts +11 -4
- package/packages/core/src/kernel/ticket-migrations.ts +139 -0
- package/packages/core/src/operator/annotations.ts +6 -0
- package/packages/core/src/operator/index.ts +2 -0
- package/packages/core/src/operator/presentation.ts +5 -0
- package/packages/core/src/operator/query.ts +51 -11
- package/packages/core/src/operator/registry.ts +17 -1
- package/packages/core/src/operator/restack.ts +51 -0
- package/packages/core/src/operator/tickets.ts +30 -26
- package/packages/core/src/plugin-sdk/index.ts +10 -0
- package/packages/core/src/plugins/manifest.ts +1 -1
- package/packages/core/src/ports/forge/contract.ts +23 -0
- package/packages/core/src/ports/forge/fake.ts +6 -2
- package/packages/core/src/ports/forge/git-rewrite.ts +92 -64
- package/packages/core/src/ports/forge/github-transport.ts +45 -2
- package/packages/core/src/ports/forge/github.ts +56 -17
- package/packages/core/src/ports/forge/local-git.ts +7 -2
- package/packages/core/src/ports/forge-failure.ts +40 -0
- package/packages/core/src/ports/forge-request-context.ts +35 -0
- package/packages/core/src/ports/forge-telemetry.ts +16 -0
- package/packages/core/src/ports/runner/claude.ts +136 -9
- package/packages/core/src/ports/runner/codex.ts +112 -7
- package/packages/core/src/ports/runner/contract.ts +78 -0
- package/packages/core/src/ports/runner/fake.ts +59 -1
- package/packages/core/src/ports/runner/native-cli-fixture.ts +86 -0
- package/packages/core/src/ports/runner/native-process-fixture.ts +38 -0
- package/packages/core/src/ports/runner/native-session.ts +110 -0
- package/packages/core/src/ports/runner/pi-rpc.ts +7 -1
- package/packages/core/src/ports/runner/pi.ts +162 -2
- package/packages/core/src/ports/tickets/linear.ts +180 -12
- package/packages/core/src/ports/tickets/migration.ts +92 -9
- package/packages/core/src/ports/types.ts +60 -5
- package/packages/core/src/ports/workspace/git-worktree.ts +45 -51
- package/packages/core/src/ports/workspace/vercel-sandbox.ts +28 -12
- package/packages/core/src/processes/build-child-exit.ts +50 -2
- package/packages/core/src/processes/build-child.ts +15 -7
- package/packages/core/src/processes/build-runner.ts +909 -213
- package/packages/core/src/processes/dispatcher.ts +815 -369
- package/packages/core/src/processes/execution-no-progress.ts +15 -0
- package/packages/core/src/processes/pause-execution-fixture.ts +37 -0
- package/packages/core/src/processes/phase-failure-budget.ts +2 -1
- package/packages/core/src/processes/publication-loss.ts +7 -3
- package/packages/core/src/processes/repo-view.ts +53 -6
- package/packages/core/src/processes/tick-publication.ts +6 -2
- package/packages/core/src/runtime-identity.ts +37 -0
- package/packages/core/src/store/adapter.ts +4 -2
- package/packages/core/src/store/build-scope.ts +9 -0
- package/packages/core/src/store/contract.ts +233 -16
- package/packages/core/src/store/digest.ts +20 -2
- package/packages/core/src/store/local/schema.ts +6 -0
- package/packages/core/src/store/local/store.ts +57 -4
- package/packages/core/src/store/memory.ts +83 -2
- package/packages/core/src/store/new-build.ts +2 -2
- package/packages/core/src/store/phase-session.ts +13 -0
- package/packages/core/src/store/reduced-reads.ts +43 -4
- package/packages/core/src/store/reducer-value-shapes.json +8911 -6344
- package/packages/core/src/store/reducer-value-validation.ts +103 -3
- package/packages/core/src/store/reducer-values.ts +21 -6
- package/packages/core/src/store/remote/client.ts +145 -20
- package/packages/core/src/store/remote/index.ts +2 -0
- package/packages/core/src/store/remote/protocol.ts +19 -0
- package/packages/core/src/store/remote/version.ts +2 -0
- package/packages/core/src/store/repo-state-events.ts +5 -2
- package/packages/core/src/store/repo-tick.ts +6 -1
- package/packages/core/src/store/session-handle.ts +8 -0
- package/packages/core/src/store/snapshots.ts +21 -5
- package/packages/core/src/store/types.ts +17 -1
- package/packages/core/src/testing/dispatch-read-budget.ts +18 -2
- package/packages/core/src/testing/index.ts +7 -0
- package/packages/core/src/testing/newer-writer.ts +37 -0
- package/packages/core/src/testing/reduced-read-budget.ts +3 -0
- package/skills/guide/SKILL.md +140 -25
- package/skills/guide/references/integration-tree.md +83 -4
- package/skills/guide/references/landing-policy.md +11 -0
- package/skills/guide/references/migration-1.0.md +9 -0
- package/skills/guide/references/operator-api.md +18 -0
- package/skills/guide/references/plugin-authoring.md +47 -4
- package/skills/guide/references/remote-store-protocol.md +16 -0
- package/skills/guide/references/remote-ticket-protocol.md +5 -0
- package/skills/guide/references/restacking.md +42 -7
- package/skills/guide/references/setup.md +25 -0
- package/skills/guide/references/spec-standard.md +71 -0
- package/skills/guide/references/ticket-dependencies.md +6 -45
- package/skills/guide/references/ticket-migration.md +50 -4
- package/skills/implement/SKILL.md +4 -2
- package/skills/operate/SKILL.md +63 -6
- package/skills/reconcile/SKILL.md +3 -1
- package/skills/spec/SKILL.md +62 -40
- package/skills/tickets/SKILL.md +15 -43
package/SPEC.md
CHANGED
|
@@ -342,7 +342,8 @@ Authorization follows ordered landing policy: nodes default to explicit consent,
|
|
|
342
342
|
while an auto rule authorizes a complete, verified candidate without a command.
|
|
343
343
|
They never enter plan, implement, code-review or finalize. A node conflict uses
|
|
344
344
|
source-aware reconcile. Idle collecting nodes own no execution resources;
|
|
345
|
-
verification
|
|
345
|
+
reconcile and verification use descendant-sensitive execution capacity (§12).
|
|
346
|
+
Empty nodes have no PR.
|
|
346
347
|
|
|
347
348
|
```
|
|
348
349
|
spec → plan ⇄ plan-review → implement ⇄ code-review → verify:* → finalize (+ finalize:*)
|
|
@@ -405,7 +406,9 @@ Two things wear the name:
|
|
|
405
406
|
### 6.1 The spec standard
|
|
406
407
|
|
|
407
408
|
A reference document defining "buildable": what/why not how, acceptance
|
|
408
|
-
criteria, explicit out-of-scope, evidence links
|
|
409
|
+
criteria, explicit out-of-scope, evidence links — plus sizing guidance:
|
|
410
|
+
fewer, larger tickets, split only at clean seams into a wide blocker graph so
|
|
411
|
+
independent tickets build in parallel. It is a shared resource
|
|
409
412
|
cited by **every ticket-producing surface** — `/spec`, `harvest`, every
|
|
410
413
|
`ingest:*`, and `dispatch`. An ingester's proposal is a spec written to the
|
|
411
414
|
same standard with weaker evidence.
|
|
@@ -883,19 +886,28 @@ The base-selection invariants make this safe with Git:
|
|
|
883
886
|
resumes the published branch. The kernel collapses and restacks at verify
|
|
884
887
|
entry and after target moves while awaiting landing. The first
|
|
885
888
|
`workspace.provisioned` base stays immutable branch-cut provenance; later
|
|
886
|
-
`existing` facts are resume evidence, not new cuts.
|
|
889
|
+
`existing` facts are resume evidence, not new cuts. A remote workspace lost
|
|
890
|
+
before publication may be freshly cut again; the latest `remote` or `local`
|
|
891
|
+
provisioning fact then supplies the starting base until an implementation
|
|
892
|
+
or replay range has been established.
|
|
887
893
|
- **Review loops keep their starting effective base.** The initial loop uses
|
|
888
|
-
the
|
|
894
|
+
the latest fresh cut; after a successful verify-entry restack, later failure
|
|
889
895
|
loops use that restacked contribution base. Plan, implementation and
|
|
890
896
|
code-review never rewrite the branch. Previously recorded review ranges
|
|
891
897
|
remain immutable, including between rounds.
|
|
892
|
-
- **Each implementation completion records
|
|
893
|
-
`ab done`
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
898
|
+
- **Each implementation completion records its proven contribution boundary.**
|
|
899
|
+
`ab done` uses the current projected contribution base, falling back to the
|
|
900
|
+
latest fresh-cut provisioning base (`remote` or `local`, never an `existing`
|
|
901
|
+
resume). It validates that immutable base against HEAD and records it verbatim.
|
|
902
|
+
A moving or rewritten destination never changes the review range, and review
|
|
903
|
+
requires no target fetch or merge-base calculation. Missing provenance fails
|
|
904
|
+
before publication. Successful restacks establish the baseline for later loops
|
|
905
|
+
and collapses. Historical event ranges stay immutable; the current
|
|
906
|
+
`implement.commits` projection advances to `targetBase..headSha`
|
|
907
|
+
on successful leaf `restack.rewritten`, `restack.completed`, and
|
|
908
|
+
`reconcile.rewritten` facts. `ab context` supplies that current range unchanged
|
|
909
|
+
to code review and every agent verify step. Node integration cycles retain
|
|
910
|
+
their separate range semantics.
|
|
899
911
|
- **Verification names its actual base.** Successful restack or reconcile
|
|
900
912
|
publication promotes the contribution/path base. Every new verify start and
|
|
901
913
|
result, including skips, cites the cycle's base and head. Those citations stay
|
|
@@ -1239,6 +1251,25 @@ reviewer sees prior findings but not the producer's session. What a phase
|
|
|
1239
1251
|
|
|
1240
1252
|
### 8.4 Terminal discipline [D5]
|
|
1241
1253
|
|
|
1254
|
+
Classified session deferrals consume no phase failures. Unsupported decisive
|
|
1255
|
+
facts retain the mixed-version wait gate and durable compatibility diagnostic.
|
|
1256
|
+
When the scoped `ab context` initial own-build read fails, the CLI best-effort
|
|
1257
|
+
writes `session.build-read-failed` with exact session, phase, round, operation
|
|
1258
|
+
`context`, reason `own-build-read`, and diagnostic. A valid terminal from that
|
|
1259
|
+
session wins if the agent recovers. Otherwise settlement records `phase.deferred`
|
|
1260
|
+
and `phase.deferral-escalated`, immediately projecting ordinary blocked attention.
|
|
1261
|
+
The raise cites `own-build-read:<evidenceSeq>`; replay repairs either settlement
|
|
1262
|
+
crash gap before launching another agent. An `escalation.answered` retry or
|
|
1263
|
+
guidance authorizes one fresh session without resetting genuine phase failures;
|
|
1264
|
+
a new classified failure parks again. There are zero automatic paid retries
|
|
1265
|
+
after this deferral. If evidence cannot be written, ordinary recovery applies;
|
|
1266
|
+
agent output and `no-terminal` alone never classify a read failure.
|
|
1267
|
+
|
|
1268
|
+
Ordinary silence, provider failures and session timeouts retain the runner's
|
|
1269
|
+
phase failure limit (`BuildRunnerOpts.maxPhaseAttempts`, default 2). This is
|
|
1270
|
+
an internal runner option, not an accepted `[policy]` TOML key. Reconcile
|
|
1271
|
+
execution and unchanged-base progress budgets retain their existing accounting.
|
|
1272
|
+
|
|
1242
1273
|
**Every phase ends with exactly one terminal command** — `done`, `verdict`,
|
|
1243
1274
|
or `escalate`. The CLI rejects a second terminal call, and each terminal
|
|
1244
1275
|
validates its preconditions before emitting the phase event (no `done`
|
|
@@ -1257,7 +1288,7 @@ Each failed target's transcript is deposited. Only a stopped or exhausted chain
|
|
|
1257
1288
|
emits one `phase.failed` with the final provider message verbatim; that final
|
|
1258
1289
|
failure controls retry policy. Provider exhaustion skips the retry budget and
|
|
1259
1290
|
raises a policy escalation, while availability uses the existing bounded
|
|
1260
|
-
budget. Every build-agent session also has a kernel-owned
|
|
1291
|
+
budget. Every build-agent session also has a kernel-owned active-time budget,
|
|
1261
1292
|
resolved from its logical role and then `[policy].sessionBudgetSeconds`. Expiry
|
|
1262
1293
|
aborts the turn, ends any available handle, drops producer continuation state,
|
|
1263
1294
|
and emits retryable `phase.failed` with `phase session budget expired after
|
|
@@ -1291,13 +1322,22 @@ not build failures.
|
|
|
1291
1322
|
|
|
1292
1323
|
### 8.6 Agents never touch the remote [D7]
|
|
1293
1324
|
|
|
1325
|
+
The forge is authoritative for every publication: after writing or on recovery,
|
|
1326
|
+
its branch head must equal the frozen intended SHA. Local branch refs are caches
|
|
1327
|
+
and are refreshed unconditionally after confirmation, without changing checkout
|
|
1328
|
+
contents. Explicit remote expected-head leases and durable writer reservations
|
|
1329
|
+
still fence concurrent writers. In local-git the shared ref database is itself
|
|
1330
|
+
the forge, so its authoritative writes retain compare-and-swap guards.
|
|
1331
|
+
|
|
1294
1332
|
All `git push`, PR creation, and forge API calls happen kernel-side. `ab done`
|
|
1295
|
-
in `implement`
|
|
1296
|
-
|
|
1333
|
+
in `implement` validates the recorded effective base, freezes HEAD, pushes that
|
|
1334
|
+
exact SHA, and confirms the authoritative branch head before recording
|
|
1335
|
+
`{base, head}`. A local push or readback failure writes no completion or publication
|
|
1336
|
+
request and leaves `ab done` retryable in the same session; `ab done` in `finalize` has the kernel open the PR
|
|
1297
1337
|
using the deposited `pr-description` artifact. After a successful
|
|
1298
1338
|
content-producing `finalize:*` step, the runner
|
|
1299
1339
|
requires a clean worktree and a descendant local `HEAD`, then regular-pushes
|
|
1300
|
-
the
|
|
1340
|
+
the exact validated SHA and confirms forge readback before recording that head and completing the step.
|
|
1301
1341
|
A no-op step has no push. Agents only ever commit locally. Consequences: forge
|
|
1302
1342
|
credentials **never enter the sandbox** (load-bearing once builds run on
|
|
1303
1343
|
remote sandboxes), ordinary implementation history is extended and reconcile
|
|
@@ -1328,7 +1368,9 @@ implementer: ab context (findings.json now materialized) → …
|
|
|
1328
1368
|
|
|
1329
1369
|
**Failure paths:**
|
|
1330
1370
|
|
|
1331
|
-
- *
|
|
1371
|
+
- *Classified own-build read failure, no terminal* → `phase.deferred`, then
|
|
1372
|
+
`phase.deferral-escalated`; blocked until an explicit answer, with no phase failure.
|
|
1373
|
+
- *Completed turn, no terminal and no classified deferral* → `phase.failed {no-terminal}`, retry per
|
|
1332
1374
|
policy [D5].
|
|
1333
1375
|
- *Session budget expiry* → abort and best-effort `end`, then retryable
|
|
1334
1376
|
`phase.failed {error: "phase session budget expired after … seconds"}`; retry
|
|
@@ -1347,14 +1389,16 @@ implementer: ab context (findings.json now materialized) → …
|
|
|
1347
1389
|
- *Wrong-resource access or wrong-session agent write* → the applicable
|
|
1348
1390
|
build-scoped or ambient-session Store handle rejects it at the interface;
|
|
1349
1391
|
a remote token enforces the same scope over the wire [D8].
|
|
1350
|
-
- *Store unreachable* → CLI retries with backoff;
|
|
1351
|
-
|
|
1392
|
+
- *Store unreachable* → CLI retries with backoff; when read-failure evidence can be deposited, the own-build-read attention
|
|
1393
|
+
protocol applies. If writes also fail, no durable classifier can be guaranteed;
|
|
1394
|
+
ordinary runner recovery applies.
|
|
1352
1395
|
|
|
1353
1396
|
### 8.8 Outer-loop namespace
|
|
1354
1397
|
|
|
1355
1398
|
Human/pre-build ticket grooming uses one configured-source namespace
|
|
1356
1399
|
(`ab ticket create|update|block|unblock|list|show|move`, plus the ticket-asset
|
|
1357
|
-
forms below). Migration adds `ab ticket export <dir>` and `ab ticket import <dir
|
|
1400
|
+
forms below). Migration adds `ab ticket export <dir>` and `ab ticket import <dir>`,
|
|
1401
|
+
plus `ab ticket migration record <dir>`
|
|
1358
1402
|
(see [Ticket source migration](#ticket-source-migration)). These commands are
|
|
1359
1403
|
sessionless, source-agnostic, and never available as a mid-build spec
|
|
1360
1404
|
mutation path. The CRUD subcommands accept `--json` and then writes exactly one
|
|
@@ -1456,6 +1500,7 @@ type Result =
|
|
|
1456
1500
|
interface AgentRunner {
|
|
1457
1501
|
start(opts: { skill, invocation, workspace, model, … }): { session, result }
|
|
1458
1502
|
continue(session, message): Result // review-loop rounds
|
|
1503
|
+
resume?(nativeHandle, message, freshOpts): ResumeResult
|
|
1459
1504
|
end(session): Transcript // → store, always
|
|
1460
1505
|
}
|
|
1461
1506
|
```
|
|
@@ -1474,6 +1519,69 @@ legacy plugin may omit `cause`; `permanent: false` remains alternate-eligible
|
|
|
1474
1519
|
and `permanent: true` remains a stopping failure. A failed `start` still returns
|
|
1475
1520
|
an endable session handle, guaranteeing transcript deposition.
|
|
1476
1521
|
|
|
1522
|
+
Native session identity is observed through an awaited `onNativeSession` callback
|
|
1523
|
+
on start and live continue, independently of UI streaming. The kernel appends
|
|
1524
|
+
`session.native-handle-recorded {session, phase, round?, handle}` before
|
|
1525
|
+
consuming further native output. Handles are versioned JSON facts containing
|
|
1526
|
+
adapter kind, native id, execution host, absolute workspace, and optional native
|
|
1527
|
+
state path; they contain no credentials or transcript. Requested/generated ids
|
|
1528
|
+
are not proof of a native session. No reported identity means no handle.
|
|
1529
|
+
The reducer exposes `sessions.nativeHandles` (retained after session end) and
|
|
1530
|
+
`nativeHandle` on matching open sessions. Legacy logs retain an empty map.
|
|
1531
|
+
|
|
1532
|
+
Local git-worktree runners suspend an interrupted agent turn on dispatcher
|
|
1533
|
+
SIGINT/SIGTERM. A conditional artifact deposit records `session.suspended`
|
|
1534
|
+
with cause `shutdown`, the native handle, active milliseconds, partial transcript
|
|
1535
|
+
and any known incremental usage. A terminal fact that lands first prevents
|
|
1536
|
+
suspension; suspension fences the old session's terminal credentials permanently.
|
|
1537
|
+
The process supervisor retains its existing bounded force-stop path if provider
|
|
1538
|
+
cleanup or persistence cannot complete.
|
|
1539
|
+
|
|
1540
|
+
On attachment the runner retains an eligible current phase/round session and
|
|
1541
|
+
records takeover. Matching host, workspace and runtime permit native resume;
|
|
1542
|
+
remote workspaces, missing handles, unsupported runtimes and unavailable native
|
|
1543
|
+
state produce a reasoned `session.resume-fallback` and fresh execution. Provider
|
|
1544
|
+
failures retain ordinary retry/alternate policy. Native state is an optimization;
|
|
1545
|
+
the Store remains authoritative for durable resumption.
|
|
1546
|
+
|
|
1547
|
+
A continuation is a new Autobuild bracket with fresh credentials and a new
|
|
1548
|
+
stream. `session.started.continuation` durably records its predecessor, logical
|
|
1549
|
+
root, inherited handle, interruption cause and accumulated budget before launch.
|
|
1550
|
+
This is write-ahead resume intent, not a handshake: the prompt may execute and
|
|
1551
|
+
its terminal may land before the adapter reports native acceptance through
|
|
1552
|
+
`session.resumed`. Recovery retries an unaccepted attempt using the inherited
|
|
1553
|
+
handle; a superseded attempt's late acceptance is marked stale and changes no
|
|
1554
|
+
lifecycle state. The interruption prompt names pause, shutdown or runner loss and asks
|
|
1555
|
+
the agent to re-check the worktree and re-run anything in flight. Phase and round
|
|
1556
|
+
are retained, including uncommitted local work.
|
|
1557
|
+
|
|
1558
|
+
The original budget ceiling persists across interruptions. Monotonic elapsed
|
|
1559
|
+
milliseconds charge each live segment; suspended intervals are excluded. An
|
|
1560
|
+
abruptly lost segment is conservatively charged from its recorded start to
|
|
1561
|
+
recovery. Interrupted and continuation transcripts remain separate artifacts;
|
|
1562
|
+
logical totals sum known segment usage once and preserve every transcript ref.
|
|
1563
|
+
Unknown crash usage is not fabricated.
|
|
1564
|
+
|
|
1565
|
+
Pause immediately cancels a live agent turn and records suspension with cause
|
|
1566
|
+
`pause`, including remote sessions and sessions without a native handle.
|
|
1567
|
+
Acknowledgement follows adapter stop and durable suspension (or a winning phase
|
|
1568
|
+
terminal). Remote and unsupported recovery records a reasoned fresh-session
|
|
1569
|
+
fallback. No-live-session and check-only steps retain boundary-based pause.
|
|
1570
|
+
Abort takes precedence. A resume before cancellation prevents interruption;
|
|
1571
|
+
after cancellation starts the runner finishes suspension, then honors the latest
|
|
1572
|
+
request. Pause acknowledgement uses compare-and-append so it cannot overwrite
|
|
1573
|
+
a newer resume. Repository pause settles when all affected live builds settle.
|
|
1574
|
+
|
|
1575
|
+
The optional `resume` capability continues native state in a fresh process,
|
|
1576
|
+
using explicit new execution options and environment. Success returns
|
|
1577
|
+
`{kind: 'resumed', session, result}` with a normal turn result and an endable
|
|
1578
|
+
local session. Unsupported capability, wrong adapter/host/workspace, or missing
|
|
1579
|
+
native state returns `{kind: 'not-resumable', reason, message}` through the
|
|
1580
|
+
`resumeAgent` compatibility helper. Provider failures remain normal failed
|
|
1581
|
+
turns. Adapters never replay transcripts or silently start fresh sessions.
|
|
1582
|
+
This records capability only: pause behavior and §15.6 recovery remain unchanged;
|
|
1583
|
+
recovery still reclaims open brackets and reruns the phase from its start.
|
|
1584
|
+
|
|
1477
1585
|
Narrow non-phase judgments do not widen this contract. A runtime may
|
|
1478
1586
|
separately register an optional one-shot completion capability (tool-free,
|
|
1479
1587
|
non-resumable), used for slug naming (§6.3) and vendored-skill conflict
|
|
@@ -1486,7 +1594,7 @@ deterministic fail-safe.
|
|
|
1486
1594
|
(minimum version 0.84.3), driven headlessly through `--mode rpc`, for every
|
|
1487
1595
|
provider-qualified model that installation resolves. Each adapter uses its
|
|
1488
1596
|
CLI's local authenticated login; pi also owns its local model catalog and
|
|
1489
|
-
keeps one
|
|
1597
|
+
keeps one persistent RPC process alive across review-loop continuations. All
|
|
1490
1598
|
three provide tool-free one-shot completion. Plugins may register additional
|
|
1491
1599
|
adapters, each under a *distinct runtime name*, never
|
|
1492
1600
|
as a mode flag on an existing one. Plugin adapters must pass the exported
|
|
@@ -1922,8 +2030,8 @@ is excluded. An empty completed node contributes nothing; missing or ambiguous
|
|
|
1922
2030
|
completion evidence does not mean empty. The newest build generation is used,
|
|
1923
2031
|
with ties diagnosed rather than falling back to older successful work.
|
|
1924
2032
|
|
|
1925
|
-
|
|
1926
|
-
wait for their node to land in the common ancestor and
|
|
2033
|
+
Demand-driven restacking supplies ancestor changes to descendants. Sibling changes
|
|
2034
|
+
wait for their node to land in the common ancestor and presence demand into the target;
|
|
1927
2035
|
descendant changes wait for their node to land into the target ancestor. Same-node
|
|
1928
2036
|
landings satisfy presence directly. Unknown evidence leaves source work queued,
|
|
1929
2037
|
with diagnostics naming the blocker and destination. Blockers with no build,
|
|
@@ -1950,6 +2058,17 @@ A ready node ticket opens an integration build on `ab-node/<slug>`, cut
|
|
|
1950
2058
|
from its parent's sampled head. Opening intent and acknowledgement are durable;
|
|
1951
2059
|
the branch is open to targeting tickets immediately, without a PR. Idle integration
|
|
1952
2060
|
builds use no provisioned workspace, runner, execution lease, or dispatch capacity.
|
|
2061
|
+
|
|
2062
|
+
A node requesting reconcile or verification is admitted before new ticket
|
|
2063
|
+
claims. Its candidate occupancy excludes itself and capacity-bearing blocked or
|
|
2064
|
+
paused descendants, following accepted source-qualified build target ancestry.
|
|
2065
|
+
Running descendants and unrelated builds still count; ordinary blocked and
|
|
2066
|
+
paused work retains its slot for every other admission. Provisioning reserves
|
|
2067
|
+
node occupancy before the runner starts. This exception never raises the budget
|
|
2068
|
+
for new claims. Status and both dashboards report actual occupancy, configured
|
|
2069
|
+
capacity, effective display capacity and the nodes using descendant-held slots.
|
|
2070
|
+
Idle collecting nodes remain free.
|
|
2071
|
+
|
|
1953
2072
|
An empty node has no PR and reports `integration`, `target`, and `empty`.
|
|
1954
2073
|
Once it holds commits its current parent lacks, the dispatcher opens or adopts
|
|
1955
2074
|
its PR. No placeholder commit is created; parent-only advancement is still empty.
|
|
@@ -2003,7 +2122,7 @@ new parent. Former-parent-only history is excluded; owned foreign changes and
|
|
|
2003
2122
|
source build identities survive. Existing review identity is retained and its PR
|
|
2004
2123
|
base changes after branch publication. Empty and same-head moves need no new
|
|
2005
2124
|
commit or PR. Descendants keep targeting the moved node and follow its head
|
|
2006
|
-
through
|
|
2125
|
+
through independent demand-driven restacks, including source-aware conflict reconciliation.
|
|
2007
2126
|
|
|
2008
2127
|
A supported ticket mutation records `node.parent-requested` before the provider
|
|
2009
2128
|
write under node writer authority. The dispatcher reads back the source and
|
|
@@ -2039,14 +2158,31 @@ by a human follows ordinary terminal handling. Changing a claimed work ticket's
|
|
|
2039
2158
|
refused before any combined patch is written: abort and re-dispatch is the
|
|
2040
2159
|
supported path. Unclaimed tickets retain ordinary target editing.
|
|
2041
2160
|
|
|
2042
|
-
**
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2161
|
+
**Demand-driven restacking and node writers.** Nodes observe parent movement durably but restack only on demand: before a
|
|
2162
|
+
complete nonempty node verifies; before landing if its parent moved; when queued
|
|
2163
|
+
dependency presence requires an ancestor change; on `ab restack <node>`; or on
|
|
2164
|
+
accepted re-parenting. There is no eager mode or cadence option. Nested nodes
|
|
2165
|
+
need their own demand. Existing frozen transactions, including ones reserved
|
|
2166
|
+
before upgrade, finish first; later demand coalesces onto the latest parent.
|
|
2167
|
+
Leaves keep verify-entry and awaiting-landing restacks for every target.
|
|
2168
|
+
|
|
2169
|
+
Presence demand uses change identities, never ticket resolution alone. It follows
|
|
2170
|
+
only the path from the nearest proven ancestor source down to the dependent's
|
|
2171
|
+
actual destination, processing ancestors first. Unrelated siblings stay idle;
|
|
2172
|
+
changes absent from all ancestors cannot trigger a speculative replay. Tickets
|
|
2173
|
+
remain queued until presence is observed in their destination.
|
|
2174
|
+
|
|
2175
|
+
`ab restack <node>` (operator tool `builds.restack`, input `{repo, slug}`) records
|
|
2176
|
+
a durable request, coalescing pending demand. It refuses leaves, terminal nodes,
|
|
2177
|
+
and unopened nodes. Paused or blocked nodes wait for their normal safety gates.
|
|
2178
|
+
A request arriving during replay survives until its parent and required identities
|
|
2179
|
+
are covered. Re-parenting invalidates requests for the old destination.
|
|
2180
|
+
|
|
2181
|
+
Both dashboards show `parent N commits ahead`, `parent current`, or
|
|
2182
|
+
`parent distance unknown`. Distance counts commits reachable from the observed
|
|
2183
|
+
parent but not the last confirmed contribution base; it is not elapsed time or
|
|
2184
|
+
poll count. Samples are invalidated by replay or re-parenting. A stale node
|
|
2185
|
+
cannot verify or land; inventory and child landings continue while it collects.
|
|
2050
2186
|
|
|
2051
2187
|
Node branches have one writer at a time. A distinct mutable node writer lease
|
|
2052
2188
|
(serialized independently of runner execution leases) guards both restacks and
|
|
@@ -2056,11 +2192,15 @@ boundary, immutable archives, ordered changes, and merge proofs. Expiry permits
|
|
|
2056
2192
|
recovery of that reservation, never an incompatible operation. Each change has
|
|
2057
2193
|
prepared, conflicted, or replayed receipts. Resolved objects are retained in the
|
|
2058
2194
|
BuildStore before their receipts. `node.publish-intended`, `node.rewritten`, and
|
|
2059
|
-
`node.writer-settled` distinguish intent, proven effect, and completion.
|
|
2195
|
+
`node.writer-settled` distinguish intent, proven effect, and completion. The forge
|
|
2196
|
+
is authoritative: exact intended-head readback confirms publication, while local
|
|
2197
|
+
refs are caches refreshed without CAS. An unconfirmed descendant is contention;
|
|
2198
|
+
a durable confirmed receipt can preserve a historical write. Exact
|
|
2060
2199
|
expected-head replacement and immutable archive refs preserve displaced history;
|
|
2061
2200
|
contention retains the previous contribution boundary and retries the complete
|
|
2062
2201
|
observed contribution. An untagged commit, including an empty commit, is foreign.
|
|
2063
|
-
`node.inventory`
|
|
2202
|
+
`node.inventory` retains the sampled source boundary without promoting the confirmed
|
|
2203
|
+
restack base. It reports reachable build identities separately from node-owned
|
|
2064
2204
|
foreign commits above the durable boundary; inherited foreign history is excluded
|
|
2065
2205
|
from the owned count.
|
|
2066
2206
|
|
|
@@ -2298,6 +2438,7 @@ Every event shares:
|
|
|
2298
2438
|
"seq": 42, // per-build, monotonic, assigned by the store on append
|
|
2299
2439
|
"ts": "2026-07-15T14:03:22Z", // assigned by the store
|
|
2300
2440
|
"actor": { "kind": "agent", "role": "code-review", "session": "s_9f2" },
|
|
2441
|
+
"compatibility": { "writerVersion": "1.0.0-beta.1", "classification": "decisive" },
|
|
2301
2442
|
"type": "code-review.verdict",
|
|
2302
2443
|
"payload": { /* per-type, frozen in packages/core/src/events/ */ }
|
|
2303
2444
|
}
|
|
@@ -2359,9 +2500,10 @@ rejection is `EventValidationError`.
|
|
|
2359
2500
|
channel — and polling covers commands exactly the way it covers
|
|
2360
2501
|
`subscribe`. A runner that is dead still receives pause/resume/abort
|
|
2361
2502
|
commands and escalation answers on resume. While a turn is live, the runner
|
|
2362
|
-
subscribes from its session boundary and forwards
|
|
2503
|
+
subscribes from its session boundary and forwards pause or abort as caller-owned
|
|
2363
2504
|
cancellation to the AgentRunner; it closes the session transcript without
|
|
2364
|
-
recording `phase.failed
|
|
2505
|
+
recording `phase.failed`, records suspension for pause, and acknowledges the
|
|
2506
|
+
current control. The supervising execution
|
|
2365
2507
|
retains the lease until the build's complete process tree has been reaped.
|
|
2366
2508
|
|
|
2367
2509
|
### 15.3 Catalog
|
|
@@ -2378,14 +2520,14 @@ with illustrative members:
|
|
|
2378
2520
|
| Operator commands [D2] | `build.pause-requested` → `build.paused`; `build.discard-requested`; `build.hold-requested`; `build.land-requested` → `landing.command-acknowledged`; `escalation.answered` (optionally carrying a validated `reviewRoundCeiling`, or the `assets` sampled with a revise-from-ticket authorization) |
|
|
2379
2521
|
| Landing policy | `landing.decided` (candidate, matched rule/default, labels, target, mode); `landing.native-enable-started`; `landing.native-applied` |
|
|
2380
2522
|
| Spec | `spec.imported`, `spec.authored`, `spec.revised` (optionally carrying `assets`, a re-pin of the ticket's assets, §6.3) |
|
|
2381
|
-
| Sessions | `session.started`; `session.ended` with transcript ref and usage (ordinary completion — the analysis corpus), or `session.ended {outcome: reclaimed, reclaimedBy: {instance, resumedFromSeq}}` (explicit transcriptless takeover) |
|
|
2523
|
+
| Sessions | `session.started` (including optional write-ahead continuation intent and budget ceiling); `session.suspended` with partial transcript and active duration; `session.resumed` acceptance (stale reports are inert); reasoned `session.resume-fallback`; kernel-only `session.native-handle-recorded` with bracket and native execution identity; `session.ended` with transcript ref and usage (ordinary completion — the analysis corpus), or `session.ended {outcome: reclaimed, reclaimedBy: {instance, resumedFromSeq}}` (explicit transcriptless takeover) |
|
|
2382
2524
|
| Plan/code loops | `plan.started` … `plan-review.verdict`; `implement.started` … `code-review.verdict` |
|
|
2383
2525
|
| Verify/finalize | `verify.started {step, attempt, feedback?, baseSha?, headSha?, restackId?}`, `verify.completed {step, outcome, skipCause?, baseSha?, headSha?, restackId?}`, `verify.reconcile-policy-captured {reconcileSeq, steps}`, `finalize.completed {pr}`, `finalize.step-started {step}`, `finalize.step-completed {step, ok, headSha?}` |
|
|
2384
2526
|
| PR summary | Kernel-authored `pr-summary.requested {occurrence, boundary}`, `pr-summary.attempted {occurrence, boundary, pr}`, `pr-summary.result {attempt, outcome, eligibleAfter?}`, `pr-summary.settled {request, disposition}`; sequence identities correlate durable starts, completed boundaries, attempts, and handoffs (§7.5) |
|
|
2385
2527
|
| PR attachments | `pr-attachment.designated`, `pr-attachment.hosted`, `pr-attachment.reclaimed`, `pr-attachment.reclaim-failed` |
|
|
2386
2528
|
| Leaf restacking | `target.moved {branch, sha}`, `restack.prepared`, `restack.replayed`, `restack.publish-intended`, `restack.rewritten`, `restack.contended`, `restack.completed` |
|
|
2387
2529
|
| Post-PR [D1] | `pr.merged`, `pr.conflicted`, `reconcile.progress-checked`, `reconcile.started`, `reconcile.prepared`, `reconcile.replayed`, `reconcile.publish-intended`, `reconcile.rewritten`, `reconcile.contended`, `reconcile.completed` |
|
|
2388
|
-
| Cross-cutting | `observation.recorded`, `escalation.raised`, `phase.failed` |
|
|
2530
|
+
| Cross-cutting | `observation.recorded`, `escalation.raised`, `phase.failed`, `session.build-read-failed`, `phase.deferred`, `phase.deferral-escalated` |
|
|
2389
2531
|
| Repository journal | dispatcher setting facts; run lifecycle, effective config, tick/queue diagnostics, reload and runner outcomes; the `harvest.*` workflow, recovery, and ledger facts |
|
|
2390
2532
|
|
|
2391
2533
|
Abort cleanup is a dispatcher-owned ordered saga. While an execution lease is
|
|
@@ -2393,7 +2535,7 @@ live, the janitor defers the saga so it cannot race process-tree teardown. Once
|
|
|
2393
2535
|
that supervisor releases the lease, or an abruptly orphaned lease expires, cleanup
|
|
2394
2536
|
closes an open unmerged PR without overriding a racing merge, releases the workspace,
|
|
2395
2537
|
deletes the exact published remote branch and exact local branch, unions the
|
|
2396
|
-
`autobuild:aborted` label into the current ticket labels, returns the ticket to
|
|
2538
|
+
`autobuild:aborted` label into the current ticket labels, posts an abort notice, and returns the ticket to
|
|
2397
2539
|
configured Triage, and only then completes as `abandoned`. External effects are
|
|
2398
2540
|
idempotent and the three `abort.*` facts checkpoint projections across crashes;
|
|
2399
2541
|
missing Forge capabilities or outages leave the remainder due on the next tick.
|
|
@@ -2428,6 +2570,47 @@ chain survives `policy.stallRounds` rounds.
|
|
|
2428
2570
|
|
|
2429
2571
|
### 15.5 Derived state (the reducer)
|
|
2430
2572
|
|
|
2573
|
+
**Mixed-version reads.** Within the supported client window, readers that
|
|
2574
|
+
implement this contract preserve raw unknown facts and skip them in functional
|
|
2575
|
+
reducers. Known payloads project away added fields recursively while retaining
|
|
2576
|
+
validation of all known fields, required fields, enums and refinements. Writes
|
|
2577
|
+
remain strict. Every build and repository catalog type has an explicit
|
|
2578
|
+
`advisory` or `decisive` classification. Producers stamp their own release and
|
|
2579
|
+
classification in envelope `compatibility` metadata before transport; backing
|
|
2580
|
+
stores check supplied classifications against their catalog. Legacy known types
|
|
2581
|
+
use the local catalog; legacy unknown types are conservatively decisive with
|
|
2582
|
+
an unavailable-writer-version diagnostic. Added fields on existing types must
|
|
2583
|
+
be advisory; new semantics requiring old kernels to stop use a new decisive type.
|
|
2584
|
+
|
|
2585
|
+
Build reductions retain reader-relative unknown and decisive counts, unsupported
|
|
2586
|
+
types and producer versions. Unknown facts advance raw cursors, including when
|
|
2587
|
+
they trail the last known fact. Unknown decisive facts defer claims, phase
|
|
2588
|
+
routing, integration and landing/publication decisions for that build only;
|
|
2589
|
+
read-only status/context/dashboard reads retain the lifecycle status. The
|
|
2590
|
+
kernel or dispatcher records advisory `build.compatibility-deferred` with the
|
|
2591
|
+
decisive boundary, types, versions and diagnostic, deduplicated per boundary.
|
|
2592
|
+
Default `ab watch` attention includes it. Diagnostics request a build that
|
|
2593
|
+
understands the unsupported types and name the writer releases, even when
|
|
2594
|
+
writer and reader share a release string. Upgrading clears deferral through
|
|
2595
|
+
local replay without answering an escalation. Repository unknown counts do
|
|
2596
|
+
not invent per-build blockers.
|
|
2597
|
+
|
|
2598
|
+
Event-derived caches require both the exact reducer version and a deterministic
|
|
2599
|
+
read-catalog identity, including build/repository type classifications and a
|
|
2600
|
+
read-decoder revision. Named and generic checkpoints use catalog-specific keys;
|
|
2601
|
+
legacy/foreign-catalog snapshots are misses and are preserved. Unrecognized
|
|
2602
|
+
reducer versions replay without repairing their cache. No lower-version write
|
|
2603
|
+
replaces a higher-version row, even at a later cursor. Corrupt caches of the
|
|
2604
|
+
reader's own version may be conditionally repaired. Hosted named answers require
|
|
2605
|
+
matching version, catalog identity and locally valid finished shape; otherwise
|
|
2606
|
+
the client replays raw events locally through the returned cursor without
|
|
2607
|
+
writing the service cache. Catalog identity travels in response header
|
|
2608
|
+
`x-autobuild-catalog-identity`; strict JSON bodies remain exactly
|
|
2609
|
+
`{version, cursor, value}`. Missing/malformed headers also trigger local replay.
|
|
2610
|
+
A service omits identity for a backend without one. This guarantee excludes
|
|
2611
|
+
readers predating this contract and does not widen the supported client window.
|
|
2612
|
+
|
|
2613
|
+
|
|
2431
2614
|
A nonterminal integration with `node.opened` derives `collecting` (below paused
|
|
2432
2615
|
and blocked in precedence); it requires no attached runner. Empty/holding changes
|
|
2433
2616
|
comes from `node.compared`, independently of admission openness. Integration
|
|
@@ -2444,8 +2627,23 @@ dispatcher-authored. Existing merged/closed PR, abort and completion facts close
|
|
|
2444
2627
|
Node transaction state reduces `node.writer-reserved`, `node.item-prepared`,
|
|
2445
2628
|
`node.item-conflicted`, `node.item-replayed`, `node.publish-intended`,
|
|
2446
2629
|
`node.rewritten`, `node.writer-settled`, and `node.inventory` (§13.1 integration
|
|
2447
|
-
|
|
2630
|
+
restacking). Durable `node.restack-requested` facts retain operator/presence demand,
|
|
2631
|
+
including destination, sampled parent, dependent ticket and required identities.
|
|
2632
|
+
Reservations freeze covered request ids; confirmed settlement acknowledges only
|
|
2633
|
+
that coverage, and `node.restack-satisfied` records coverage or destination change.
|
|
2634
|
+
`node.parent-distance` records immutable base/parent/branch and count (null when unknown).
|
|
2635
|
+
It retains the previous contribution boundary, latest parent
|
|
2448
2636
|
observation, complete replay prefix, active source item and merge proofs.
|
|
2637
|
+
`integration.observed` optionally carries display-only `children` entries
|
|
2638
|
+
(source/id, optional title and contribution build identity). Open-child and
|
|
2639
|
+
contribution arrays remain the membership authorities; resolved tickets without
|
|
2640
|
+
contributions do not become landed children. Dashboards list open children first
|
|
2641
|
+
with current live phase or `queued`, then contributions as `landed`. They show
|
|
2642
|
+
expected verification steps with exact current-cycle/head/parent outcomes and
|
|
2643
|
+
landing mode/rule/consent instructions. Optional `files` on `node.item-conflicted`
|
|
2644
|
+
and conflicted `restack.replayed` records unmerged paths at replay. Legacy events
|
|
2645
|
+
remain readable with explicit unavailable-title/file fallbacks; display metadata
|
|
2646
|
+
never authorizes collection or landing.
|
|
2449
2647
|
A rewrite receipt alone never promotes the boundary; only completed settlement
|
|
2450
2648
|
does. CLI status exposes pending/active work, reachable build identities and
|
|
2451
2649
|
node-owned foreign changes. A node stays `collecting` while its narrow reconcile
|
|
@@ -2469,9 +2667,9 @@ Runner state retains ordered `runner.setup-failed {command,attempt,exitStatus,
|
|
|
2469
2667
|
output}` facts and projects the latest one until a later `runner.attached`
|
|
2470
2668
|
proves successful setup recovery. A legacy `session.started` with no ending
|
|
2471
2669
|
continues to project as open. On takeover, the recovering runner explicitly
|
|
2472
|
-
|
|
2473
|
-
resume boundary before
|
|
2474
|
-
started
|
|
2670
|
+
retains the eligible current native session and reclaims unrelated open
|
|
2671
|
+
brackets at its captured resume boundary before `runner.attached`. Without a
|
|
2672
|
+
usable native candidate, only a subsequently started fresh session can be open.
|
|
2475
2673
|
|
|
2476
2674
|
Every projection — operator UI, CLI status, dispatcher decisions — is a
|
|
2477
2675
|
reduction of the logs. `ab builds` and `ab build status` additionally present
|
|
@@ -2530,7 +2728,12 @@ discarded}` last. No runner is required.
|
|
|
2530
2728
|
report}` → kernel routes back into the code loop: `implement.started
|
|
2531
2729
|
{round: 2, feedback: {verify: {step, report}}}` → fix → `code-review` round
|
|
2532
2730
|
2 → approve → verify re-runs **from the first step** (implement changed the
|
|
2533
|
-
code; cheap checks first), `attempt: 2`. `policy.maxVerifyAttempts`
|
|
2731
|
+
code; cheap checks first), `attempt: 2`. `policy.maxVerifyAttempts` counts distinct failed logical verify cycles since
|
|
2732
|
+
the latest spec revision; duplicate failure evidence for one attempt counts once.
|
|
2733
|
+
Passed or skipped target-movement, restack and reconcile cycles consume zero.
|
|
2734
|
+
Cycle identifiers remain monotonic independently of this budget. The history
|
|
2735
|
+
pass, pass, pass, fail uses one failure even when the failing cycle is attempt 4.
|
|
2736
|
+
The third distinct failed cycle at the default limit escalates. Budget
|
|
2534
2737
|
exhausted → `escalation.raised {source: "policy"}`. Guidance answering that
|
|
2535
2738
|
policy escalation routes to `implement` and outranks the pending report. By
|
|
2536
2739
|
contrast, when the agent verifier itself uses `ab escalate`, guidance answering
|
|
@@ -2576,7 +2779,11 @@ executes no setup, appends no `runner.attached`, and starts no phase or session.
|
|
|
2576
2779
|
Resume and all decisions that use the workspace still require successful setup.
|
|
2577
2780
|
The setup target belongs only to escalation metadata and is not a pipeline `Phase`.
|
|
2578
2781
|
|
|
2579
|
-
**D — sandbox death:**
|
|
2782
|
+
**D — runner loss and sandbox death:** local git-worktrees first attempt the
|
|
2783
|
+
native continuation described in §9. The following remote-sandbox recovery
|
|
2784
|
+
retains its fresh-session fallback.
|
|
2785
|
+
|
|
2786
|
+
**Remote sandbox death:** log ends at `session.started {session: old}` after
|
|
2580
2787
|
`implement.started {round: 2}`; heartbeat goes stale → dispatcher expires the
|
|
2581
2788
|
lease, records the old execution identity, stops/deletes its exact deterministic
|
|
2582
2789
|
sandbox name, and confirms absence before recording `workspace.released` → it
|
|
@@ -2604,7 +2811,7 @@ Historical orphan-only logs remain valid and require no repair.
|
|
|
2604
2811
|
The re-run retains another `implement.started {round: 2}` as evidence of the
|
|
2605
2812
|
execution attempt. Duplicate starts for one logical round or attempt are not
|
|
2606
2813
|
policy units: review budget follows verdict rounds, phase retry budget follows
|
|
2607
|
-
`phase.failed`, verify budget follows failed
|
|
2814
|
+
`phase.failed`, verify budget follows distinct failed cycle identifiers after the spec revision while a crashed step
|
|
2608
2815
|
reuses its attempt, and reconcile no-progress budget follows distinct completed
|
|
2609
2816
|
attempts. Recovery alone therefore consumes none of those budgets. The provider
|
|
2610
2817
|
restores the already-created branch at round 1's pushed head [D3]; the Git
|
|
@@ -2735,10 +2942,9 @@ session to end and remote kernels wait for guest teardown before replacement;
|
|
|
2735
2942
|
conflict outcome and archive refs after confirmed publication. A successful CAS
|
|
2736
2943
|
that is overtaken before readback still records its receipt, with `observedHead`
|
|
2737
2944
|
naming the later head (or null for deletion). That observed head informs recovery;
|
|
2738
|
-
it does not complete reconcile or promote the verification base.
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
evidence of a new write. New completion is
|
|
2945
|
+
it does not complete reconcile or promote the verification base. Recovery may
|
|
2946
|
+
consume a durable confirmed write receipt; candidate ancestry alone never proves
|
|
2947
|
+
an unconfirmed write. New completion is
|
|
2742
2948
|
`{headSha, rewriteId, artifact}`; historical `{mergeCommit, artifact}` remains
|
|
2743
2949
|
valid. Remote requests carry identical transaction inputs and use the provider's
|
|
2744
2950
|
trusted rewrite/archive capability only after execution teardown. Contention is
|
|
@@ -2808,13 +3014,17 @@ in either case. Explicit landing arrays remain byte-for-byte unchanged. Missing
|
|
|
2808
3014
|
configuration or unavailable journals fail with recovery guidance. Fresh init
|
|
2809
3015
|
uses the no-rules fallback.
|
|
2810
3016
|
|
|
2811
|
-
A native-enable failure
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
3017
|
+
A classified transient native-enable failure records a candidate-specific
|
|
3018
|
+
application failure even before the provider's mutation guard. An uncertain
|
|
3019
|
+
enable after that guard requires confirmed cancellation before publication.
|
|
3020
|
+
During forge cooldown it stays pending; cancellation makes no further provider
|
|
3021
|
+
request until recovery. A confirmed cancellation's disabled receipt can retain
|
|
3022
|
+
retry timing. Retries back off from 30 seconds exponentially to a five-minute
|
|
3023
|
+
maximum interval, surviving dispatcher restarts, and honor any later repository
|
|
3024
|
+
reset. A new candidate or land command resets the application delay; hold wakes
|
|
3025
|
+
janitor backoff but provider cancellation still honors repository cooldown.
|
|
3026
|
+
Quiet polls append no attempt facts. Native application receipts and janitor
|
|
3027
|
+
bookkeeping are not pipeline execution progress.
|
|
2818
3028
|
|
|
2819
3029
|
Native auto-merge is reconciled on every janitor poll against durable desired
|
|
2820
3030
|
landing state using the native state in the existing PR read, without additional
|
|
@@ -3430,6 +3640,25 @@ the installed guide. Export keeps lifecycle membership without inferring roles;
|
|
|
3430
3640
|
import reuses unique case-insensitive states and creates normalized missing ones.
|
|
3431
3641
|
|
|
3432
3642
|
|
|
3643
|
+
Completed `ab ticket import <dir> [--store <ref>]` records a durable repository
|
|
3644
|
+
`tickets.migration-recorded` fact after all ticket and asset work succeeds. The
|
|
3645
|
+
fact carries the stable export identity, source/destination adapter names and
|
|
3646
|
+
complete actual ID mapping. `ab ticket migration record <dir> [--store <ref>]`
|
|
3647
|
+
verifies a manifest-backed export used directly as a file source, checking every
|
|
3648
|
+
ID and creation key, and records the same continuity without importing. Tickets
|
|
3649
|
+
filed afterward in the exported tracker are allowed; only original manifest IDs
|
|
3650
|
+
enter that mapping.
|
|
3651
|
+
|
|
3652
|
+
Current operations resolve historical ticket references forward through recorded
|
|
3653
|
+
mappings. Completeness, targeting, admission, ancestry and lifecycle writes
|
|
3654
|
+
retain their gates. Missing routes, uncovered IDs and inconsistent evidence fail
|
|
3655
|
+
closed at current-ticket and frozen-membership operation boundaries; unrelated
|
|
3656
|
+
uncovered history does not block intake or alias current-source tickets. History
|
|
3657
|
+
is never rewritten. Preserve the BuildStore and repository,
|
|
3658
|
+
quiesce ticket writers during cutover, and resume in-flight builds after recording
|
|
3659
|
+
and destination validation. See [the migration procedure](docs/ticket-migration.md).
|
|
3660
|
+
|
|
3661
|
+
|
|
3433
3662
|
### Tree and consent operator reads
|
|
3434
3663
|
|
|
3435
3664
|
The shared dashboard projection supplies root, node, target, integration build,
|
|
@@ -3460,3 +3689,28 @@ reports current gate deferrals or unsafe forge outcomes, never a second consent
|
|
|
3460
3689
|
or hold wake. Readiness observations and queue entries share the effective
|
|
3461
3690
|
target shape `{kind, branch, ticket?, build?}`. Tree display labels are owned
|
|
3462
3691
|
by the shared projection vocabulary and reused by terminal and CLI text.
|
|
3692
|
+
|
|
3693
|
+
## Forge failure recovery
|
|
3694
|
+
|
|
3695
|
+
Janitor failures are durable per-build episodes. Eligible failures retry after
|
|
3696
|
+
30, 60, 120, 240 seconds, then at the configured cap (300 seconds by default).
|
|
3697
|
+
Skipped polls preserve the episode across restart. After
|
|
3698
|
+
`policy.janitorFailureAttentionSeconds` (600 by default), `build.janitor-failing`
|
|
3699
|
+
notifies default watchers and appears on the build row. A successful attempt
|
|
3700
|
+
clears it. `policy.janitorBackoffMaxSeconds` sets the positive integer cap.
|
|
3701
|
+
|
|
3702
|
+
A classified forge rate limit records repository degradation with `resetAt`.
|
|
3703
|
+
Forge work waits during cooldown; passing the deadline permits a recovery
|
|
3704
|
+
request, and only success clears degradation. A further limit extends cooldown.
|
|
3705
|
+
Native landing application failures keep candidate-specific retry eligibility,
|
|
3706
|
+
including automatic decisions without a human command. Retries recheck consent,
|
|
3707
|
+
holds, verification and the exact candidate. Uncertain enables remain pending
|
|
3708
|
+
until cancellation can be confirmed after cooldown. Publication retries reuse
|
|
3709
|
+
cancellation receipts only when the forge confirms the same disabled state for
|
|
3710
|
+
the same candidate and publication operation.
|
|
3711
|
+
|
|
3712
|
+
Tick telemetry counts provider wire requests, including failures. Counts are
|
|
3713
|
+
unavailable for uninstrumented adapters. Attribution retains at most ten builds
|
|
3714
|
+
ordered by descending count then build name; repository requests are unattributed.
|
|
3715
|
+
Repository status names a hotspot only when one build makes at least two requests
|
|
3716
|
+
and more than half of attributed requests. Telemetry never controls workflow.
|
package/bin/ab-build-runner.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
/** Private shipped child: one operating-system process per build. */
|
|
3
3
|
import { runBuildChild } from '../packages/core/src/processes/build-child'
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
BuildChildExitCoordinator,
|
|
6
|
+
BuildChildShutdown,
|
|
7
|
+
} from '../packages/core/src/processes/build-child-exit'
|
|
5
8
|
import { watchBuildParent } from '../packages/core/src/processes/build-parent-watch'
|
|
6
9
|
import { BUILD_RUNNER_OPTIONS_ENV } from '../packages/core/src/ports/workspace/local-build-execution'
|
|
7
10
|
import {
|
|
@@ -30,17 +33,16 @@ if (input.supervision.kind === 'local-parent') {
|
|
|
30
33
|
// session. Environment-owned execution deliberately installs neither this
|
|
31
34
|
// group reaper nor a meaningless host-PID watchdog.
|
|
32
35
|
const terminal = new BuildChildExitCoordinator({ groupId: process.pid })
|
|
33
|
-
|
|
34
|
-
process.on('
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
)
|
|
36
|
+
const shutdown = new BuildChildShutdown(terminal)
|
|
37
|
+
process.on('SIGINT', () => shutdown.request(130))
|
|
38
|
+
process.on('SIGTERM', () => shutdown.request(143))
|
|
39
|
+
terminal.setParentWatch(watchBuildParent(input.supervision.parentPid, () => shutdown.finish(143)))
|
|
38
40
|
try {
|
|
39
|
-
await runBuildChild(input, process.env, undefined, { guest })
|
|
41
|
+
await runBuildChild(input, process.env, undefined, { guest, shutdownSignal: shutdown.signal })
|
|
40
42
|
} catch {
|
|
41
43
|
exitCode = 1
|
|
42
44
|
}
|
|
43
|
-
|
|
45
|
+
shutdown.finish(exitCode)
|
|
44
46
|
} else {
|
|
45
47
|
// Vercel owns teardown of the complete VM session. Addressing a POSIX group
|
|
46
48
|
// here could leave the SDK believing a still-running environment completed.
|