@defrex/autobuild 1.17.0 → 1.19.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 +85 -11
- package/docs/architecture.md +57 -11
- package/docs/configuration.md +11 -3
- package/docs/dispatcher-hosting.md +5 -3
- package/docs/operator-api.md +14 -1
- package/docs/plugin-authoring.md +29 -1
- package/docs/remote-ticket-protocol.md +34 -1
- package/docs/restacking.md +5 -0
- package/docs/setup.md +9 -3
- package/docs/ticket-sources.md +28 -1
- package/docs/troubleshooting.md +15 -0
- package/docs/workspaces.md +1 -1
- package/package.json +4 -4
- package/packages/core/src/cli/dashboard/refresh.ts +8 -0
- package/packages/core/src/cli/dispatch.ts +2 -0
- package/packages/core/src/config/schema.ts +2 -1
- package/packages/core/src/events/catalog-identity.ts +3 -1
- package/packages/core/src/events/payloads.ts +7 -1
- package/packages/core/src/events/repository.ts +37 -1
- package/packages/core/src/kernel/__snapshots__/reducer-identity-records/d41044cb2e54809c.json +194 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-records/e012e9e8f3e82935.json +424 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-records/e0f89f52e48cbf62.json +197 -0
- package/packages/core/src/kernel/janitor-failure.ts +1 -0
- package/packages/core/src/kernel/reducer-revisions.ts +9 -0
- package/packages/core/src/kernel/reducer.ts +6 -0
- package/packages/core/src/kernel/repository-read-facts.ts +9 -2
- package/packages/core/src/kernel/session-settlement.ts +82 -0
- package/packages/core/src/kernel/ticket-preparation.ts +10 -0
- package/packages/core/src/operator/registry.ts +64 -9
- package/packages/core/src/operator/tickets.ts +139 -25
- package/packages/core/src/plugin-sdk/index.ts +4 -0
- package/packages/core/src/plugins/manifest.ts +1 -1
- package/packages/core/src/ports/tickets/completion.ts +71 -0
- package/packages/core/src/ports/tickets/contract.ts +73 -0
- package/packages/core/src/ports/tickets/github-fake.ts +8 -0
- package/packages/core/src/ports/tickets/github-issues.ts +1 -0
- package/packages/core/src/ports/tickets/github.ts +18 -6
- package/packages/core/src/ports/tickets/hosted-index.ts +8 -0
- package/packages/core/src/ports/tickets/linear.ts +18 -2
- package/packages/core/src/ports/tickets/remote-protocol.ts +37 -8
- package/packages/core/src/ports/tickets/remote.ts +41 -3
- package/packages/core/src/ports/tickets/tree.ts +11 -1
- package/packages/core/src/ports/types.ts +32 -4
- package/packages/core/src/ports/workspace/vercel-sandbox.ts +78 -25
- package/packages/core/src/processes/build-runner.ts +100 -29
- package/packages/core/src/processes/dispatcher.ts +1016 -279
- package/packages/core/src/processes/execution-settlement.ts +30 -0
- package/packages/core/src/processes/pass-stages.ts +32 -6
- package/packages/core/src/store/reducer-value-shapes.json +8440 -8346
- package/packages/core/src/store/remote/released-clients.json +22 -0
- package/packages/core/src/store/remote/released-reducer-values/1.18.0.json +36436 -0
- package/packages/core/src/store/remote/released-reducer-values/1.19.0.json +36461 -0
- package/packages/core/src/store/remote/released-reducer-values/index.ts +20 -16
- package/packages/core/src/testing/dispatch-read-budget.ts +143 -16
- package/packages/core/src/testing/index.ts +2 -0
- package/packages/core/src/testing/reduced-read-budget.ts +234 -2
- package/skills/guide/SKILL.md +45 -15
- package/skills/guide/references/operator-api.md +14 -1
- package/skills/guide/references/plugin-authoring.md +29 -1
- package/skills/guide/references/remote-ticket-protocol.md +34 -1
- package/skills/guide/references/restacking.md +5 -0
- package/skills/guide/references/setup.md +9 -3
- package/skills/operate/SKILL.md +18 -1
- package/templates/hosted-service/package.json +2 -2
package/README.md
CHANGED
|
@@ -26,7 +26,7 @@ From the repository you want built, install Autobuild as a development dependenc
|
|
|
26
26
|
<!-- release-install:start -->
|
|
27
27
|
|
|
28
28
|
```sh
|
|
29
|
-
bun add -d --exact @defrex/autobuild@1.
|
|
29
|
+
bun add -d --exact @defrex/autobuild@1.19.0
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
<!-- release-install:end -->
|
package/SPEC.md
CHANGED
|
@@ -99,7 +99,7 @@ Interfaces to the world, each with swappable adapters:
|
|
|
99
99
|
| `TelemetrySource` | production signals | Sentry; later log streams |
|
|
100
100
|
| `BuildStore` | per-build streams plus repository journals: events, artifacts, transcripts, leases (see §7) | local; remote HTTP |
|
|
101
101
|
|
|
102
|
-
Ticket sources may optionally provide native `listPage(criteria, page)` windows with a matching total. Paged operator reads use it when present, otherwise slice the exhaustive listing; unpaged and dispatcher reads remain exhaustive.
|
|
102
|
+
Ticket sources may optionally provide native `listPage(criteria, page)` windows with a matching total. Paged operator reads use it when present, otherwise slice the exhaustive listing; unpaged and dispatcher reads remain exhaustive. A source declaring `completionPaging` also honours completion filters (`excludeLabels`, `since`/`until` over `Ticket.resolvedAt`, order `completed`) natively, capped per request; for other sources the operator filters the exhaustive listing.
|
|
103
103
|
Ticket sources may optionally provide `search(query)`: title/body term matching with state/label filters, returning compact hits and an opaque cursor. Callers refuse sources without it and never fall back to listing.
|
|
104
104
|
Integration-tree sources may optionally provide `listTargeting(nodeId)`, every ticket targeting one node in every state, equal to the exhaustive listing filtered by target. Integration observation uses it when present, otherwise `listAll`.
|
|
105
105
|
|
|
@@ -505,7 +505,11 @@ files, including development configs, remain exactly as installed.
|
|
|
505
505
|
a won claim, the selected creation slug and, when the build store attests keyed
|
|
506
506
|
creation, the attempt's creation key are durable boundaries. Caught
|
|
507
507
|
asset-copy, spec-authoring, naming, and build-creation failures return the ticket
|
|
508
|
-
to configured Ready; a nonconforming spec goes to configured Triage.
|
|
508
|
+
to configured Ready; a nonconforming spec goes to configured Triage. A bounded
|
|
509
|
+
invocation stamps each intent with its work deadline; an attempt that deadline
|
|
510
|
+
interrupted before `build.created`, with no failure or bounce recorded, is not a
|
|
511
|
+
failure and is never returned to Ready: it is carried and resumed (§8.1).
|
|
512
|
+
Recovery
|
|
509
513
|
point-reads the selected slug and, for a keyed attempt, the canonical slug derived
|
|
510
514
|
from the repository, selected slug and key: one matching record and atomic
|
|
511
515
|
`build.created` retain ownership even if creation threw after committing or its
|
|
@@ -788,7 +792,11 @@ next stage, or finalize after the last, waits for every member to pass or skip.
|
|
|
788
792
|
On a normal stage transition the runner drains agent turns before stage-local
|
|
789
793
|
shutdown: a terminal may precede trailing artifacts, transcript deposit and
|
|
790
794
|
`session.ended`. Parent shutdown and session budgets still interrupt this drain;
|
|
791
|
-
fail-fast retains immediate whole-execution cancellation.
|
|
795
|
+
fail-fast retains immediate whole-execution cancellation. A member's session is
|
|
796
|
+
ended once its step has an outcome, before the next stage or finalize starts.
|
|
797
|
+
When the adapter yields no endable handle or transcript after the terminal, the
|
|
798
|
+
runner ends it `reclaimed` rather than leaving it open; any agent phase whose
|
|
799
|
+
terminal is durable closes its bracket the same way.
|
|
792
800
|
|
|
793
801
|
By default a failure lets all siblings finish; the settled stage routes once
|
|
794
802
|
with every failed report, and no later stage runs. `failFast = true` on either
|
|
@@ -2049,6 +2057,41 @@ keeps the cut execution's `instance` and the step still owed (`fence` or
|
|
|
2049
2057
|
that instance still holds the lease; the lease never waits on its TTL. A
|
|
2050
2058
|
carried entry retires without launching when its build is aborted, discarded,
|
|
2051
2059
|
paused or no longer needs the start.
|
|
2060
|
+
Ticket preparations are carried the same way, before `build.created`. Intake
|
|
2061
|
+
does not start a preparation with less time left before the work deadline than
|
|
2062
|
+
a preparation needs (about 30 s, the dispatcher's `preparationEstimateMs`).
|
|
2063
|
+
Once the ticket passes every admission gate, capacity included, intake journals
|
|
2064
|
+
the admission as a preparation intent with `claimDeferred`, makes no tracker
|
|
2065
|
+
call, carries the attempt and stops claiming. A preparation the work deadline
|
|
2066
|
+
cuts before `build.created` is carried too, with no failure recorded, no
|
|
2067
|
+
recovery and no tracker write. Carried attempts are listed, by ticket and
|
|
2068
|
+
attempt, in `dispatcher.work-deferred` and counted as `preparationsCarried`; the
|
|
2069
|
+
dispatch log names each ticket and the pass's stage record lists it as
|
|
2070
|
+
`carried`. The next invocation resumes each attempt first, after the carried
|
|
2071
|
+
builds, from its last durable boundary. An attempt never claimed is claimed
|
|
2072
|
+
now: a second intent for the same attempt, without `claimDeferred`, is
|
|
2073
|
+
journaled before the claim call, and from then on recovery treats the claim as
|
|
2074
|
+
possibly applied. A claim that applied but was never confirmed is confirmed
|
|
2075
|
+
from the ticket's state. A claimed attempt continues from its asset pin, and a
|
|
2076
|
+
selected creation is read back as in recovery. A deferred attempt whose ticket
|
|
2077
|
+
left Ready or reports unresolved blockers, or whose repository turned intake
|
|
2078
|
+
off, resolves `lost-claim` with no tracker write, and intake decides the ticket
|
|
2079
|
+
again. Admission is decided once, when the intent is written: the intent also
|
|
2080
|
+
records the admitted build level (a non-manual start request's own level, or
|
|
2081
|
+
the ticket's claim tier), and a carried attempt's build takes that level even
|
|
2082
|
+
after its start request settles. Finishing a carried attempt never re-measures
|
|
2083
|
+
capacity. Instead, every capacity measurement counts each unresolved carried
|
|
2084
|
+
attempt as an occupied slot until it resolves, however many passes its resume
|
|
2085
|
+
takes (a tracker outage included), so no intake claim, start request or slot
|
|
2086
|
+
admission spends it. A slot request or start request that appears in between
|
|
2087
|
+
waits, as it would behind an in-flight claim. The unresolved attempt withholds
|
|
2088
|
+
its ticket from other claims meanwhile. The
|
|
2089
|
+
work-deadline stamp is the backstop when the hint is lost: preparation recovery
|
|
2090
|
+
resumes an attempt whose stamp has passed and that recorded no failure or
|
|
2091
|
+
bounce, instead of handing it back. A resumed preparation that fails for real
|
|
2092
|
+
takes the ordinary failure path, and one the deadline cuts again is carried
|
|
2093
|
+
again under the same attempt. Start requests get the same estimate gate but
|
|
2094
|
+
journal nothing; their pending request is already the carry.
|
|
2052
2095
|
No stage consumes a bounded pass. Its stages run in order (deferred work,
|
|
2053
2096
|
settlement, ticket preparations, janitor, recovery, lease sweep, admission,
|
|
2054
2097
|
intake), and each may start new items only until its share of the time left
|
|
@@ -2687,7 +2730,11 @@ Local git-worktree runners suspend an interrupted agent turn on dispatcher
|
|
|
2687
2730
|
SIGINT/SIGTERM. A conditional artifact deposit records `session.suspended`
|
|
2688
2731
|
with cause `shutdown`, the native handle, active milliseconds, partial transcript
|
|
2689
2732
|
and any known incremental usage. A terminal fact that lands first prevents
|
|
2690
|
-
suspension
|
|
2733
|
+
suspension and ends the bracket instead, `reclaimed` when no transcript is
|
|
2734
|
+
available; a remote shutdown does the same for a finished occurrence.
|
|
2735
|
+
Suspension fences the old session's terminal credentials permanently. A
|
|
2736
|
+
dispatcher-settled suspension (below) also carries the ended `execution
|
|
2737
|
+
{instance, outcome}`; its continuation cause is `runner-loss`.
|
|
2691
2738
|
Graceful shutdown waits for provider cleanup and durable suspension without a
|
|
2692
2739
|
wall-clock force-exit deadline. Only after the runner leader exits does bounded
|
|
2693
2740
|
process-group cleanup reap remaining descendants. Abnormal parent loss retains
|
|
@@ -5510,7 +5557,7 @@ with illustrative members:
|
|
|
5510
5557
|
| Operator commands [D2] | `build.abort-requested {reason?, to?, origin?: {kind: optimization-stop, node}}` → `build.aborted` (a human, or the dispatcher for an attempt of a stopped optimization node, §13.1.1); `build.pause-requested` → `build.paused`; `build.discard-requested`; `build.hold-requested {reason?}`; `build.priority-set {priority, level?}` (advisory slot-admission level, §12); `build.land-requested` → `landing.command-acknowledged`; decisive human `build.reopened {feedback?, spec?: {artifact, assets?}}` (§15.7); `escalation.answered` (optionally carrying a validated `reviewRoundCeiling`, or the `assets` sampled with a revise-from-ticket authorization) |
|
|
5511
5558
|
| Merge policy | `landing.decided` (candidate, matched rule/default, labels, target, mode, matched `paths?` summary); advisory `landing.deferred` (candidate, reason, rule, policy); kernel `landing.consent-revoked {commandSeq, source, rule, previousHead, head, consentedHead?, paths}`; `landing.native-enable-started`; `landing.native-applied`; advisory dispatcher `landing.polling-selected {candidate, decisionSeq, commandSeq?, detail}` and `landing.human-merge-required {candidate, decisionSeq, commandSeq?, cause: merge-queue-rule \| merge-queue-activity \| merge-refused, detail}` |
|
|
5512
5559
|
| Spec | `spec.imported`, `spec.authored`, `spec.revised` (either positive `escalation` sequence or exclusive `operator: {user, via?}` provenance for an idle node or a settled leaf's reopen, §15.7; optionally carrying `assets`, a re-pin of the ticket's assets, §6.3) |
|
|
5513
|
-
| Sessions | `session.started` (including optional write-ahead continuation intent, budget ceiling, and the effective first `prompt` the bracket sent: the start prompt, the live continuation message, or the interruption notice); `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) |
|
|
5560
|
+
| Sessions | `session.started` (including optional write-ahead continuation intent, budget ceiling, and the effective first `prompt` the bracket sent: the start prompt, the live continuation message, or the interruption notice); `session.suspended` with partial transcript and active duration (and, when the dispatcher settled it after its execution ended, that `execution {instance, outcome}`); `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) |
|
|
5514
5561
|
| Plan/code loops | `plan.started` … `plan-review.verdict`; `implement.started` … `code-review.verdict`; agent `implement.declined {round, reason, artifact?}` (decisive), an optimization attempt's alternative implement terminal: the build completes `closed-unmerged` and the dispatcher writes `attempt.settled {outcome: declined, note}` on the node (§13.1.1) |
|
|
5515
5562
|
| Verify/finalize | `verify.started {step, attempt, feedback?, baseSha?, headSha?, restackId?}`, `verify.completed {step, outcome, skipCause?: post-reconcile-policy \| clean-restack-policy, baseSha?, headSha?, restackId?}`, `verify.cancelled {step, attempt, cause: {step}, baseSha?, headSha?, restackId?}`, `verify.stage-failed {attempt, cycle, stage, failed, cancelled, baseSha?, headSha?, restackId?}`, `verify.reconcile-policy-captured {reconcileSeq, steps}`, `finalize.completed {pr}`, `finalize.step-started {step}`, `finalize.step-completed {step, ok, headSha?}` |
|
|
5516
5563
|
| Integration attention | Kernel/dispatcher `integration.verification-failed {id, head, parent, steps, guidance}`: one durable failed-cycle notification, recovered from exact verification receipts |
|
|
@@ -6344,17 +6391,44 @@ every actionable build on its first tick rather than waiting for the sweep;
|
|
|
6344
6391
|
lease claiming stays the exclusivity gate, so a genuinely live old runner
|
|
6345
6392
|
wins harmlessly.
|
|
6346
6393
|
|
|
6347
|
-
|
|
6348
|
-
|
|
6349
|
-
|
|
6394
|
+
Sessions open only inside executions, so an execution that ends never leaves
|
|
6395
|
+
its sessions open. When a build has a recorded execution, none is open, no
|
|
6396
|
+
live lease is held and sessions remain open, the dispatcher settles every one
|
|
6397
|
+
of them in place at its next sweep or janitor visit, without launching a
|
|
6398
|
+
runner. A pause, an open escalation, a pending abort or a terminal status does
|
|
6399
|
+
not defer this. A done or aborted build, or one with an abort pending, resumes
|
|
6400
|
+
nothing, so every session it left open is ended `reclaimed`; the janitor does
|
|
6401
|
+
this before abort cleanup, and the dispatcher that records a terminal build's
|
|
6402
|
+
`execution.ended` first ends the sessions that execution left open, so a
|
|
6403
|
+
crash between the two leaves the execution open and the build visited. On any
|
|
6404
|
+
other build, an unfinished occurrence that carries a native handle — the one the
|
|
6405
|
+
engine runs next, or, while a hold keeps the engine waiting, one with no
|
|
6406
|
+
durable terminal (an outcome, its own escalation or wait, a failure, or a
|
|
6407
|
+
completed phase) — is `session.suspended` with cause `shutdown`, a placeholder
|
|
6408
|
+
transcript and the ended `execution {instance, outcome}`; the next runner
|
|
6409
|
+
resumes it natively as a runner loss, or records the ordinary fallback where
|
|
6410
|
+
native resume is unavailable. Every other open session — a step that already
|
|
6411
|
+
has its outcome, a superseded round or attempt, a session with no handle — is
|
|
6412
|
+
ended `reclaimed`.
|
|
6413
|
+
Each write is conditional on the build's cursor, so a runner that attached
|
|
6414
|
+
meanwhile wins and the next visit decides again. The janitor settles before it
|
|
6415
|
+
reads landing readiness, so a finished leaf reaches its landing decision in the
|
|
6416
|
+
same visit. Once settlement closes a remote guest's last session, the host's
|
|
6417
|
+
publication settlement requests and publishes any summary boundary the guest
|
|
6418
|
+
never requested.
|
|
6419
|
+
|
|
6420
|
+
A running, unblocked, unpaused build with an orphaned open session and no
|
|
6421
|
+
recorded execution, or whose settlement lost a race, still has pending kernel
|
|
6422
|
+
cleanup even when the phase engine waits on its PR. With no live lease or
|
|
6423
|
+
execution, the next admitted sweep attaches a runner through ordinary session
|
|
6350
6424
|
reclamation before summary and landing readiness can proceed. A provider-proved
|
|
6351
6425
|
end reuses the healthy workspace; a proved loss uses fenced replacement. An
|
|
6352
6426
|
unobserved open execution is not proof of death. Intentionally suspended sessions
|
|
6353
6427
|
and idle collecting nodes do not trigger this cleanup. A proved-ended execution
|
|
6354
6428
|
with actionable work or eligible cleanup bypasses absent-lease first-claim grace;
|
|
6355
|
-
never-attached builds retain grace. Detection
|
|
6356
|
-
no history replay or new poll. Existing infrastructure
|
|
6357
|
-
retry budgets govern failed recovery.
|
|
6429
|
+
never-attached builds retain grace. Detection and settlement use canonical
|
|
6430
|
+
reduced facts, with no history replay or new poll. Existing infrastructure
|
|
6431
|
+
failure attention and retry budgets govern failed recovery.
|
|
6358
6432
|
|
|
6359
6433
|
Verification's current result boundary also advances on `verify.config-captured`
|
|
6360
6434
|
and `verify.config-superseded` (§16.1). These facts do not change reconcile
|
package/docs/architecture.md
CHANGED
|
@@ -866,6 +866,27 @@ holder before anything else. Starts are tracked in flight, and bounded
|
|
|
866
866
|
teardown awaits `Dispatcher.settleCutStarts()` as a racer beside provisioning
|
|
867
867
|
abandonment, before the repository lease is released; it prints each deferral
|
|
868
868
|
line the tick has not reported, and the cut pass's partial summary counts them.
|
|
869
|
+
Ticket preparations are carried before `build.created` too (#1431). Intake's
|
|
870
|
+
claim loop calls `Dispatcher.prepareTicket`, the one preparation path from the
|
|
871
|
+
`intended` append to the first dispatch, tracked as a start in flight. In a
|
|
872
|
+
bounded pass `appendIntended` stamps `workDeadlineAt` and the admitted `level`,
|
|
873
|
+
which a resumed attempt reuses; `preparationWontFit`
|
|
874
|
+
compares the time left with `preparationEstimateMs` (default 30 s), and
|
|
875
|
+
`deferPreparation` journals the admission as `intended` with `claimDeferred`
|
|
876
|
+
and no tracker call. A preparation the deadline cuts takes `prepareTicket`'s
|
|
877
|
+
cut branch instead of `failPreparation`. Both note the attempt through
|
|
878
|
+
`notePreparationCarry`, which writes the hint's `tickets` list beside its
|
|
879
|
+
builds and records the ticket on the pass's stage part (`PassStageTracker.carry`).
|
|
880
|
+
`serviceDeferredWork` resumes carried attempts after carried builds through
|
|
881
|
+
`resumeCarriedPreparation`, which re-reads the ticket, confirms or claims as
|
|
882
|
+
the attempt's durable boundaries require (journaling a second `intended` as
|
|
883
|
+
the claim-started boundary of a deferred claim), and re-enters `prepareTicket`
|
|
884
|
+
with `resume`. It uses `creationReadback`, the readback it shares with
|
|
885
|
+
`recoverTicketPreparation`.
|
|
886
|
+
Every capacity measurement goes through `measureCapacity`, which adds
|
|
887
|
+
`reservedPreparations()` (unresolved, deadline-stamped attempts with no failure
|
|
888
|
+
or bounce) to the occupied slots, so a carried admission keeps its slot until
|
|
889
|
+
it resolves.
|
|
869
890
|
Stage fairness lives in `processes/pass-stages.ts` (pure: shares, rotation,
|
|
870
891
|
the stage record and its rendering). `Dispatcher.runTick` wraps each stage in
|
|
871
892
|
`runStage`, which hands its helpers a copy of the tick options whose
|
|
@@ -1056,7 +1077,7 @@ dispatch is tolerated. `Ticket.creationKey` is the optional stable external
|
|
|
1056
1077
|
create/adoption correlation, distinct from `Ticket.ref.id`; Linear projects its
|
|
1057
1078
|
issue UUID and file/fake preserve their idempotency metadata through create,
|
|
1058
1079
|
adoption, get, and list paths. Legacy/plugin tickets may omit it and dispatch
|
|
1059
|
-
unchanged. The ticket-source port optionally exposes `listPage(criteria, page)` for paged operator reads. PostgreSQL counts matches and applies SQL LIMIT/OFFSET; the remote hosted client forwards pages over the `list-page` ticket operation; other sources retain exhaustive-read slicing. CLI and dispatcher reads stay exhaustive. The optional `search(query)` serves `tickets.search` and `ab ticket search`; PostgreSQL answers it with one keyset-paged bounded statement, the remote hosted client forwards it over the `search` ticket operation, and the Linear source answers it with one team-filtered GraphQL `issues` request per page; the GitHub source answers it with one GitHub issue-search request per page on GitHub's separate search quota; `ports/tickets/search.ts` holds the shared matcher and cursor pager, the `TicketSearchUnsupported` refusal for sources without it, and `searchTickets`, the caller entry point. See [ticket source contract](ticket-sources.md#writing-your-own).
|
|
1080
|
+
unchanged. The ticket-source port optionally exposes `listPage(criteria, page)` for paged operator reads, with completion filters (`ports/tickets/completion.ts`) for sources declaring `completionPaging`. PostgreSQL counts matches and applies SQL LIMIT/OFFSET, answering completion filters with at most two range scans over its completion index (a count and a window), each stopping at 5,001 rows, and refusing a state and range over 5,000 tickets; the remote hosted client forwards pages over the `list-page` ticket operation; other sources retain exhaustive-read slicing. CLI and dispatcher reads stay exhaustive. The optional `search(query)` serves `tickets.search` and `ab ticket search`; PostgreSQL answers it with one keyset-paged bounded statement, the remote hosted client forwards it over the `search` ticket operation, and the Linear source answers it with one team-filtered GraphQL `issues` request per page; the GitHub source answers it with one GitHub issue-search request per page on GitHub's separate search quota; `ports/tickets/search.ts` holds the shared matcher and cursor pager, the `TicketSearchUnsupported` refusal for sources without it, and `searchTickets`, the caller entry point. See [ticket source contract](ticket-sources.md#writing-your-own).
|
|
1060
1081
|
|
|
1061
1082
|
The `github` source spans four modules. `ports/tickets/github.ts` is the
|
|
1062
1083
|
adapter: REST over the forge's `GitHubRequest` transport and credential order,
|
|
@@ -1777,7 +1798,11 @@ and `ab context` writes them under `$AB_CONTEXT_DIR/assets/`.
|
|
|
1777
1798
|
|
|
1778
1799
|
`kernel/ticket-preparation.ts` projects unfinished `ticket-preparation.*` facts
|
|
1779
1800
|
through `repositoryReadFacts`; `processes/dispatcher.ts` retries them under the
|
|
1780
|
-
existing repository ownership before intake.
|
|
1801
|
+
existing repository ownership before intake. An attempt stamped with a passed
|
|
1802
|
+
`workDeadlineAt` and no recorded failure or bounce was interrupted by its
|
|
1803
|
+
bounded invocation's deadline: `recoverTicketPreparations` resumes it through
|
|
1804
|
+
`resumeCarriedPreparation` instead of handing it back, unless the deferred
|
|
1805
|
+
stage already did this tick. This pre-record recovery differs
|
|
1781
1806
|
from `dispatch.failed`, which completes an already established build.
|
|
1782
1807
|
`kernel/ticket-starts.ts` reduces operator single-ticket start requests
|
|
1783
1808
|
(`ticket.start-*`) and the durable canonical identities of hosted active builds
|
|
@@ -2419,8 +2444,11 @@ Local git-worktree runners suspend an interrupted agent turn on dispatcher
|
|
|
2419
2444
|
SIGINT/SIGTERM. A conditional artifact deposit records `session.suspended`
|
|
2420
2445
|
with cause `shutdown`, the native handle, active milliseconds, partial transcript
|
|
2421
2446
|
and any known incremental usage. A terminal fact that lands first prevents
|
|
2422
|
-
suspension
|
|
2423
|
-
|
|
2447
|
+
suspension and ends the bracket instead, `reclaimed` when no transcript is
|
|
2448
|
+
available; a remote shutdown does the same for a finished occurrence.
|
|
2449
|
+
Suspension fences the old session's terminal credentials permanently. A
|
|
2450
|
+
dispatcher-settled suspension also carries the ended `execution`, and its
|
|
2451
|
+
continuation cause is `runner-loss`. Graceful shutdown waits for provider cleanup and durable suspension without a
|
|
2424
2452
|
wall-clock force-exit deadline. Only after the runner leader exits does bounded
|
|
2425
2453
|
process-group cleanup reap remaining descendants. Abnormal parent loss retains
|
|
2426
2454
|
the detached reaper recovery path.
|
|
@@ -2771,14 +2799,32 @@ only live per-member handles and recovery contexts; durable starts, outcomes,
|
|
|
2771
2799
|
cancellations and failed-stage receipts drive every barrier and restart.
|
|
2772
2800
|
Normal stage transitions drain terminal-reached agent turns before stage-local
|
|
2773
2801
|
interruption, retaining session budgets and parent shutdown. This closes session
|
|
2774
|
-
brackets and deposits trailing evidence before summary publication.
|
|
2802
|
+
brackets and deposits trailing evidence before summary publication. A member
|
|
2803
|
+
whose step has an outcome has its bracket ended before the stage returns, as
|
|
2804
|
+
`reclaimed` when the adapter yields no transcript; the runner closes any
|
|
2805
|
+
terminal-reached bracket it cannot end with a transcript the same way. Fail-fast
|
|
2775
2806
|
cancellation records facts before immediate whole-execution teardown and replacement.
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2807
|
+
Open sessions of an ended execution are settled in place by the dispatcher,
|
|
2808
|
+
without a runner, at the lease sweep and at the janitor visit before landing
|
|
2809
|
+
readiness, on running, paused, blocked and aborted builds alike. Whoever
|
|
2810
|
+
records `execution.ended` for a done or aborted build (`settleOpenExecution`
|
|
2811
|
+
and the local dispatch exit) first ends its open sessions through
|
|
2812
|
+
`endTerminalBuildSessions`, so a crash in between leaves the execution open
|
|
2813
|
+
and the build visited. The pure partition is
|
|
2814
|
+
`kernel/session-settlement.ts`: a terminal build, or one with an abort pending,
|
|
2815
|
+
ends every session; otherwise an unfinished occurrence with a native handle —
|
|
2816
|
+
the engine's next one, or one whose terminal guard is still clear while a hold
|
|
2817
|
+
keeps the engine waiting — is `session.suspended` (`shutdown`, with the ended
|
|
2818
|
+
`execution`, retained by read decoder revision 13) and resumes as a runner
|
|
2819
|
+
loss; every other session is ended `reclaimed`. Writes are cursor-conditional,
|
|
2820
|
+
and the host's publication settlement then repairs any unrequested summary.
|
|
2821
|
+
The lease sweep still treats eligible running orphaned open brackets with no
|
|
2822
|
+
recorded execution as pending cleanup even on an engine wait. It excludes live
|
|
2823
|
+
leases/executions, blocked or paused builds and idle collecting nodes, then uses
|
|
2824
|
+
ordinary runner attachment/reclamation. Proved-ended pending work bypasses
|
|
2825
|
+
first-claim grace; healthy ended workspaces are reused and lost environments
|
|
2826
|
+
follow fenced recovery. Both paths use existing canonical reduced facts and add
|
|
2827
|
+
no event-log reads. `kernel/verify-stage-state.ts` owns occurrence/session associations,
|
|
2782
2828
|
including escalation supersession and complete implement feedback references.
|
|
2783
2829
|
|
|
2784
2830
|
Human access uses `postgres-store/src/organizations.ts` and the shared hosted
|
package/docs/configuration.md
CHANGED
|
@@ -1460,7 +1460,7 @@ preflight = "test \"$(pi --version)\" = \"0.84.4\" && pi update --models"
|
|
|
1460
1460
|
- **Reload:** Dispatcher restart required; startup adapters retain their configuration. Build-owned pipeline: captured from the execution checkout each verify cycle; later base-branch edits do not replace it. Workspace provisioning applies at the next build launch. A running invocation keeps its captured values.
|
|
1461
1461
|
- **Local override:** Committed only: set in autobuild.toml.
|
|
1462
1462
|
|
|
1463
|
-
**Description:** required nonblank shell command; use an immutable package version, digest, or commit
|
|
1463
|
+
**Description:** required nonblank shell command; use an immutable package version, digest, or commit; also reruns in place when the runtime's preflight fails at a relaunch, so it must be safe to run over an existing install
|
|
1464
1464
|
|
|
1465
1465
|
**Constraints:** install must be nonblank
|
|
1466
1466
|
|
|
@@ -1561,7 +1561,10 @@ Autobuild distribution and dependency bootstrap. Then runtime provisioning runs
|
|
|
1561
1561
|
each referenced runtime's `install` and `preflight` commands in sorted
|
|
1562
1562
|
runtime-name order from the checkout. Only `environmentVariables` values enter
|
|
1563
1563
|
runtime commands. The same sequence runs in fresh readiness sandboxes and every
|
|
1564
|
-
replacement sandbox.
|
|
1564
|
+
replacement sandbox. A relaunch into an existing sandbox reruns each selected
|
|
1565
|
+
runtime's `preflight`; when one fails, that runtime's `install` runs in place
|
|
1566
|
+
and its `preflight` runs again, so a `[roles]` change that selects a new
|
|
1567
|
+
runtime reaches existing sandboxes at their next launch. Provisioning writes its readiness marker only after all
|
|
1565
1568
|
scrubbing, Bun verification, system steps, distribution installation,
|
|
1566
1569
|
dependency bootstrap, and runtime preflights complete; distribution
|
|
1567
1570
|
packing/install disables package lifecycle scripts so
|
|
@@ -1676,7 +1679,12 @@ start provisioning with less than about 150 s of budget left; it records
|
|
|
1676
1679
|
`provisioningDeferred` in the tick report, logs the build, and records it in
|
|
1677
1680
|
`dispatcher.work-deferred`, so the next invocation provisions it first. That
|
|
1678
1681
|
includes the first provision of a build intake just claimed: the build keeps
|
|
1679
|
-
its slot, and the next invocation completes its dispatch first.
|
|
1682
|
+
its slot, and the next invocation completes its dispatch first. Intake starts a
|
|
1683
|
+
ticket preparation (claim, spec import, build creation) only with about 30 s
|
|
1684
|
+
left. Otherwise it holds the admitted ticket, logs
|
|
1685
|
+
`ticket <id>: preparation carried by the invocation budget`, and the next
|
|
1686
|
+
invocation prepares it first. A preparation the work deadline cuts is carried
|
|
1687
|
+
the same way. Neither is handed back to Ready.
|
|
1680
1688
|
|
|
1681
1689
|
The representative actual-provider check is opt-in and must point at an
|
|
1682
1690
|
independent consuming repository whose `autobuild.toml` selects the universal
|
|
@@ -96,9 +96,11 @@ invocation after the last item they started; priority-ordered loops (node
|
|
|
96
96
|
admission, start requests, ready tickets, ticket waits) keep their order. Each
|
|
97
97
|
pass logs a `stages:` line; see
|
|
98
98
|
[a stage keeps stopping at the work deadline](troubleshooting.md#a-stage-keeps-stopping-at-the-work-deadline).
|
|
99
|
-
Deferred work is every start a pass admitted but didn't finish (a
|
|
100
|
-
launch the work deadline cut, or a stopped-sandbox
|
|
101
|
-
invocation runs it first.
|
|
99
|
+
Deferred work is every start a pass admitted but didn't finish (a ticket
|
|
100
|
+
preparation, a provision, a launch the work deadline cut, or a stopped-sandbox
|
|
101
|
+
recovery); the next invocation runs it first. A ticket preparation that won't
|
|
102
|
+
fit, or that the deadline cuts, keeps its ticket and is never handed back to
|
|
103
|
+
Ready.
|
|
102
104
|
|
|
103
105
|
### Origin-mode dispatcher with remote workspaces
|
|
104
106
|
|
package/docs/operator-api.md
CHANGED
|
@@ -93,7 +93,7 @@ raw session-event append. External operator harnesses own agent execution.
|
|
|
93
93
|
| `GET …/status` | Repository intake, pause, and default-auto-merge projection, plus `ticketStarts` (`{pending, recent}`, each entry with its `priority`) when single-ticket start requests are pending or recently settled. `capacity.slots`, when the held configuration is readable, maps each nonterminal build to its slot state; `capacity.occupied` counts its `held` entries. Its `operator` is `{presence: "unavailable", reason}`: this route does not load presence registrations, so it is not evidence that no operator is present. |
|
|
94
94
|
| `GET …/harvest/status` | Harvest gate, runs, steps, recovery, and attention projection. |
|
|
95
95
|
| `GET …/builds/{slug}/artifacts/{kind}?rev=N` | Raw bytes (`application/octet-stream`) plus content-disposition and `X-Autobuild-Artifact-*` metadata headers. Omit `rev` for latest. |
|
|
96
|
-
| `GET …/tickets?state=S&label=L&limit=N&offset=K&order=O` | `{states,tickets,diagnostics,criteria,triageState,readyState,doneState,total}`. The three lifecycle names come from effective repository configuration (including provider fallback). With no `state`, `criteria.state` is `triageState`; repeated `label` parameters narrow that state with AND filters. An explicit `state` selects that exact backend workflow state. `limit` (0–200) returns one page, after skipping `offset`, in `order` `oldest` (the default: priority order, urgent, high, normal, then low tickets, each in the source order) or `newest` (newest filed first, regardless of priority; see paging below); `total` counts every match before paging. |
|
|
96
|
+
| `GET …/tickets?state=S&label=L&limit=N&offset=K&order=O` | `{states,tickets,diagnostics,criteria,triageState,readyState,doneState,total}`. The three lifecycle names come from effective repository configuration (including provider fallback). With no `state`, `criteria.state` is `triageState`; repeated `label` parameters narrow that state with AND filters. An explicit `state` selects that exact backend workflow state. `limit` (0–200) returns one page, after skipping `offset`, in `order` `oldest` (the default: priority order, urgent, high, normal, then low tickets, each in the source order) or `newest` (newest filed first, regardless of priority; see paging below); `total` counts every match before paging. Tickets carry `resolvedAt` and, beside `target`, `targetTitle` when known; see completion listings below. |
|
|
97
97
|
| `GET …/tickets/states` | Full state metadata `{name,tickets,about?}[]`, including empty states (`tickets.states` in MCP). |
|
|
98
98
|
| `GET …/tickets/{id}` | `{ticket,blockers,build,assets}`. Blockers include native `exists`/`resolved` status; `build` prefers an active matching repository build, otherwise the most recently updated one. `assets` lists the current ticket assets as `{kind,name,revision,size,layout,fileCount}`, as `ab ticket show --json` does. |
|
|
99
99
|
|
|
@@ -874,6 +874,19 @@ are successful cleanup; provider errors never count as completed deletion.
|
|
|
874
874
|
|
|
875
875
|
Paged ticket listings use the source's optional native `listPage(criteria, page)` capability when present, otherwise read the full listing, order it, and slice it: by default priority order (urgent, high, normal, then low tickets, each in source order); for `newest`, the reversed listing. `newest` means newest filed first, regardless of priority, with a stable tie-break; it is not the reverse of priority order. A source that lists in filing order (file, GitHub, Linear) gets exactly that from the reversed listing. The remote `HostedTicketSource` pages natively through the service's `list-page` operation, and uses the fallback only against a service predating it. Native errors propagate. PostgreSQL counts matches without bodies and reads only the requested window. Zero limits and offsets past the end still report the full matching total. Unpaged listings remain exhaustive; the wire payload is the same for both paths.
|
|
876
876
|
|
|
877
|
+
Completion listings (`tickets.list` in MCP) answer "what shipped" digests:
|
|
878
|
+
|
|
879
|
+
| Input | Effect |
|
|
880
|
+
|---|---|
|
|
881
|
+
| `since`, `until` | ISO-8601 with offset; half-open `since <= resolvedAt < until`. Tickets without `resolvedAt` never match. Either one defaults `state` to the effective done state. `since` must precede `until`. |
|
|
882
|
+
| `order: "completed"` | Most recently completed first, ties newest filed first; tickets without a completion time follow, newest filed first. |
|
|
883
|
+
| `excludeLabels` | Drops any ticket carrying any named label; ANDed with `labels`, `state` and the range; `total` counts after it. |
|
|
884
|
+
| `summary: true` | Omits each ticket's `body` and `comments`; every other field, `revision` included, stays. |
|
|
885
|
+
|
|
886
|
+
- **Paging.** `order` and `offset` apply with or without `limit`. Any of `offset`, `order`, `since`, `until` or `excludeLabels` without `limit` pages at 200, the maximum; `total` still counts every match. A call with none of them stays exhaustive.
|
|
887
|
+
- **Fields.** `resolvedAt` is the ISO-8601 completion time, present only on resolved tickets whose source knows it (hosted, GitHub, Linear; never the file source). `targetTitle` is the target node's title, returned when resolvable: from the source's own read, a parent already in the listing, or one `get` per distinct remaining parent. A parent that is missing or whose read fails leaves `targetTitle` absent. `criteria` echoes the state, labels, `excludeLabels`, `since` and `until` applied.
|
|
888
|
+
- **Cost.** A source declaring completion paging (hosted) answers natively with at most two index range scans of the state and range, each stopping at 5,001 tickets: one counts the matches, a second reads the requested window. A zero `limit` or a refusal stops after the first. A range holding more than 5,000 tickets refuses with `code: "completion-range-too-broad"`; narrow `since`/`until`. `excludeLabels` or `order: "completed"` alone on a state holding more than 5,000 tickets refuses too. Other sources, and hosted services that predate completion listing, filter their full state listing and never refuse.
|
|
889
|
+
|
|
877
890
|
|
|
878
891
|
### Forge cooldown admission and explicit recovery
|
|
879
892
|
|
package/docs/plugin-authoring.md
CHANGED
|
@@ -252,6 +252,7 @@ A plugin relying on a capability declares an `apiVersion` range containing its v
|
|
|
252
252
|
- **1.10** Optional ticket-source ready-assignee capability (`readyAssignee`, with `prepareReadyAssignee`, `readyAssigneeRefusal` and `describeReadyAssignee`); sources without it refuse `[tickets].readyAssignee`. Also optional targeted ticket listing (`listTargeting`); older tree sources are observed through `listAll`.
|
|
253
253
|
- **1.11** Optional ticket-source search (`search`); callers refuse sources without it and never fall back to a listing.
|
|
254
254
|
- **1.12** Host-provided factory-context `fetch` and `invocationSignal` for bounded-invocation cancellation.
|
|
255
|
+
- **1.13** Optional ticket completion listing (`completionPaging`, with `TicketPageCriteria`, order `completed` and the `TicketCompletionRangeTooBroad` refusal), and the listing-time `Ticket.resolvedAt` and `Ticket.targetTitle`; callers filter the exhaustive listing for sources without it.
|
|
255
256
|
|
|
256
257
|
## 2. Create a repository-local module
|
|
257
258
|
|
|
@@ -651,7 +652,7 @@ for any other label.
|
|
|
651
652
|
## Optional ticket paging capability
|
|
652
653
|
|
|
653
654
|
Native paging is an optional API 1.9 ticket-source capability:
|
|
654
|
-
`listPage?(criteria:
|
|
655
|
+
`listPage?(criteria: TicketPageCriteria, page: TicketPage): Promise<TicketPageListing>`.
|
|
655
656
|
The SDK exports these types; the result is `TicketListing & { total: number }`.
|
|
656
657
|
Criteria retain state, labels (AND), and assignee semantics. The page has a
|
|
657
658
|
nonnegative integer `limit`, optional nonnegative integer `offset` (default 0),
|
|
@@ -675,6 +676,33 @@ File, Linear and GitHub retain fallback; the remote `HostedTicketSource`
|
|
|
675
676
|
forwards pages to the service's native paging (`list-page`), falling back only
|
|
676
677
|
against a service predating it. The POST list-ready protocol stays exhaustive.
|
|
677
678
|
|
|
679
|
+
Completion listing is an optional API 1.13 extension of native paging.
|
|
680
|
+
`listPage` takes `TicketPageCriteria`: the criteria above plus
|
|
681
|
+
`excludeLabels` (drop any ticket carrying any named label), and `since`
|
|
682
|
+
(inclusive) and `until` (exclusive) bounds on `Ticket.resolvedAt`; tickets
|
|
683
|
+
without a completion time never match. `TicketPage.order` adds `completed`:
|
|
684
|
+
tickets with `resolvedAt` first, most recent first, ties newest filed first,
|
|
685
|
+
then the rest newest filed first. Declare `completionPaging: true` only when
|
|
686
|
+
`listPage` honours all of these; callers send them only to sources declaring it
|
|
687
|
+
and otherwise filter the exhaustive listing with the SDK's shared semantics. A
|
|
688
|
+
native source may refuse a range broader than its per-request cap with
|
|
689
|
+
`TicketCompletionRangeTooBroad` (the SDK exports it and
|
|
690
|
+
`TICKET_COMPLETION_SCAN_LIMIT`); callers surface it as the
|
|
691
|
+
`completion-range-too-broad` refusal and never fall back. The shared contract
|
|
692
|
+
suite checks declared completion paging.
|
|
693
|
+
|
|
694
|
+
Tickets may carry two listing-time facts outside `revision`: `resolvedAt`, the
|
|
695
|
+
ISO-8601 time the ticket entered its completed state (only when `resolved`),
|
|
696
|
+
and `targetTitle`, the target node's title (only beside `target`). Return them
|
|
697
|
+
when your read already has them. The hosted PostgreSQL source records
|
|
698
|
+
`resolvedAt` when a ticket enters the done state, uses the last update for done
|
|
699
|
+
tickets that predate it, and projects `targetTitle` in its listing statements.
|
|
700
|
+
GitHub reports `closed_at` for completed issues and the parent title it reads
|
|
701
|
+
for targeting; Linear reports `completedAt` (or `canceledAt`) and the parent's
|
|
702
|
+
title. The file source reports no `resolvedAt`; operator listings fill a
|
|
703
|
+
missing `targetTitle` from tickets already listed, then with one `get` per
|
|
704
|
+
remaining parent.
|
|
705
|
+
|
|
678
706
|
## Optional ticket search capability
|
|
679
707
|
|
|
680
708
|
Text search is an optional API 1.11 ticket-source capability:
|
|
@@ -185,7 +185,7 @@ The operation names and `input` values are:
|
|
|
185
185
|
| `state-counts` | `{names: string[]}` (1–16) | `{name, tickets}[]` for the names that resolve |
|
|
186
186
|
| `list-ready` | `{labels?: string[], state?: string}` | `TicketListing` |
|
|
187
187
|
| `list-targeting` | `{nodeId: string}` | `TicketListing` of every state |
|
|
188
|
-
| `list-page` | `{criteria: {labels?, state?}, page: {limit, offset?, order?}}` | `TicketPageListing` (`{tickets, diagnostics, total}`) |
|
|
188
|
+
| `list-page` | `{criteria: {labels?, state?, excludeLabels?, since?, until?}, page: {limit, offset?, order?}}` | `TicketPageListing` (`{tickets, diagnostics, total}`) |
|
|
189
189
|
| `search` | `{text, state?, labels?, limit, cursor?}` | `{tickets: {id, title, state?, labels, kind, target?, priority?}[], cursor?, diagnostics}` |
|
|
190
190
|
| `get` | `{id}` | `Ticket \| null` |
|
|
191
191
|
| `claim` | `{id}` | `{claimed: boolean}` |
|
|
@@ -532,6 +532,39 @@ listing takes the `list-ready` path by that explicit decision.
|
|
|
532
532
|
The capability is additive. It does not change the remote BuildStore protocol
|
|
533
533
|
version, and released clients, which never send `list-page`, are unaffected.
|
|
534
534
|
|
|
535
|
+
## Completion listing
|
|
536
|
+
|
|
537
|
+
Recently completed work is listed through `list-page` with completion criteria,
|
|
538
|
+
negotiated by `x-autobuild-ticket-completion: 1`:
|
|
539
|
+
|
|
540
|
+
- **Ticket fields.** `resolvedAt` (ISO-8601, when the ticket entered its done
|
|
541
|
+
state) and `targetTitle` (the target node's title, beside `target`) appear on
|
|
542
|
+
tickets in every operation's answer, only for clients that send the header.
|
|
543
|
+
Released strict decoders never see them. PostgreSQL stamps the completion time
|
|
544
|
+
on entering the done state and clears it on leaving; a done ticket written
|
|
545
|
+
before that completes at its last update.
|
|
546
|
+
- **Criteria.** `excludeLabels` drops any ticket carrying any named label.
|
|
547
|
+
`since` (inclusive) and `until` (exclusive) bound `resolvedAt`, ISO-8601 with
|
|
548
|
+
an offset; tickets without a completion time never match. `order: "completed"`
|
|
549
|
+
is most recently completed first, ties newest filed first, then tickets
|
|
550
|
+
without a completion time, newest filed first. Any of them requires
|
|
551
|
+
`criteria.state`, or the request is a `400` validation error.
|
|
552
|
+
- **Cap.** The PostgreSQL backend accepts a state and range holding at most
|
|
553
|
+
5,000 tickets. It answers with up to two index range scans, each stopping at
|
|
554
|
+
5,001 rows: one counts the matches, the second reads the requested window. A
|
|
555
|
+
zero `limit` or a refusal stops after the first. When the count scan reaches
|
|
556
|
+
the 5,001st row, the request answers
|
|
557
|
+
`409 {kind: "conflict", code: "completion-range-too-broad", error, limit}`;
|
|
558
|
+
the client reports `TicketCompletionRangeTooBroad` with the `limit`. Narrow
|
|
559
|
+
`since`/`until`. Within the cap, `total` is exact.
|
|
560
|
+
- **Refusal.** A backing source that cannot honour completion criteria answers
|
|
561
|
+
`409` with `code: "paging-unsupported"`.
|
|
562
|
+
- **Negotiation.** Every `/tickets/*` response, including errors, carries the
|
|
563
|
+
header. A client sends completion criteria only after a response carried it
|
|
564
|
+
and `list-page` is declared; otherwise it fails with `HostedTicketPagingError`
|
|
565
|
+
(`service-predates`) before any request, and operator listings filter
|
|
566
|
+
`list-ready` instead.
|
|
567
|
+
|
|
535
568
|
## Search
|
|
536
569
|
|
|
537
570
|
`search` answers one page of compact hits from the backing source's own search,
|
package/docs/restacking.md
CHANGED
|
@@ -457,6 +457,11 @@ point-reads the selected slug and, for a keyed attempt, the canonical slug deriv
|
|
|
457
457
|
from the repository, selected slug and key: one matching record and atomic
|
|
458
458
|
`build.created` retain ownership even if creation threw after committing or its
|
|
459
459
|
response was lost.
|
|
460
|
+
A bounded hosted invocation may journal an admission without a claim, when the
|
|
461
|
+
preparation would not fit before its work deadline, and stamps every intent with
|
|
462
|
+
that deadline. An attempt the deadline interrupted, with no failure or bounce
|
|
463
|
+
recorded, is carried: the next invocation resumes it first from its durable
|
|
464
|
+
boundaries, and it is never returned to Ready.
|
|
460
465
|
Unavailable or conflicting readback never authorizes release or a replacement
|
|
461
466
|
build. Pending attempts retain the original failure, latest recovery error and
|
|
462
467
|
retry deadline in the canonical repository reduced value; resolved attempts
|
package/docs/setup.md
CHANGED
|
@@ -113,9 +113,15 @@ already has required system tooling.
|
|
|
113
113
|
Put each selected runtime's immutable install and executable/version check in
|
|
114
114
|
its `runtimeProvisioning` entry. Autobuild runs install then preflight after
|
|
115
115
|
checkout dependencies in every fresh/replacement sandbox and before the
|
|
116
|
-
readiness probe, writes the marker only after success
|
|
117
|
-
|
|
118
|
-
|
|
116
|
+
readiness probe, and writes the marker only after success. Every build-runner
|
|
117
|
+
launch and harvest relaunch reruns each selected runtime's preflight. A
|
|
118
|
+
preflight that fails in an existing sandbox runs that runtime's install and
|
|
119
|
+
then its preflight again; only a failure after that install fails the launch.
|
|
120
|
+
A failure names the runtime, selecting role/alternate, and the failed field
|
|
121
|
+
(`install` or `preflight`) with the command output, and starts no agent. A
|
|
122
|
+
`[roles]` change that selects a new runtime, or a changed pin, takes effect in
|
|
123
|
+
existing workspaces at their next launch; no abort is needed, so keep each
|
|
124
|
+
install safe to run over an older install. Runtime provisioning receives
|
|
119
125
|
allowlisted legacy API credentials named by
|
|
120
126
|
`[workspace.config].environmentVariables` and automatically supplied placeholders
|
|
121
127
|
for every declared account credential variable. Account variables need no
|
package/docs/ticket-sources.md
CHANGED
|
@@ -248,7 +248,7 @@ Declare `priority` only if you store all four levels natively; without it, Autob
|
|
|
248
248
|
Declare tree support only if you keep the [optional tree contract](plugin-authoring.md#optional-ticket-tree-capability) on the same port and harness: exhaustive pagination, canonical targets, revision coverage and atomic rejection.
|
|
249
249
|
|
|
250
250
|
Native paging is an optional API 1.9 ticket-source capability:
|
|
251
|
-
`listPage?(criteria:
|
|
251
|
+
`listPage?(criteria: TicketPageCriteria, page: TicketPage): Promise<TicketPageListing>`.
|
|
252
252
|
The SDK exports these types; the result is `TicketListing & { total: number }`.
|
|
253
253
|
Criteria retain state, labels (AND), and assignee semantics. The page has a
|
|
254
254
|
nonnegative integer `limit`, optional nonnegative integer `offset` (default 0),
|
|
@@ -272,6 +272,33 @@ File, Linear and GitHub retain fallback; the remote `HostedTicketSource`
|
|
|
272
272
|
forwards pages to the service's native paging (`list-page`), falling back only
|
|
273
273
|
against a service predating it. The POST list-ready protocol stays exhaustive.
|
|
274
274
|
|
|
275
|
+
Completion listing is an optional API 1.13 extension of native paging.
|
|
276
|
+
`listPage` takes `TicketPageCriteria`: the criteria above plus
|
|
277
|
+
`excludeLabels` (drop any ticket carrying any named label), and `since`
|
|
278
|
+
(inclusive) and `until` (exclusive) bounds on `Ticket.resolvedAt`; tickets
|
|
279
|
+
without a completion time never match. `TicketPage.order` adds `completed`:
|
|
280
|
+
tickets with `resolvedAt` first, most recent first, ties newest filed first,
|
|
281
|
+
then the rest newest filed first. Declare `completionPaging: true` only when
|
|
282
|
+
`listPage` honours all of these; callers send them only to sources declaring it
|
|
283
|
+
and otherwise filter the exhaustive listing with the SDK's shared semantics. A
|
|
284
|
+
native source may refuse a range broader than its per-request cap with
|
|
285
|
+
`TicketCompletionRangeTooBroad` (the SDK exports it and
|
|
286
|
+
`TICKET_COMPLETION_SCAN_LIMIT`); callers surface it as the
|
|
287
|
+
`completion-range-too-broad` refusal and never fall back. The shared contract
|
|
288
|
+
suite checks declared completion paging.
|
|
289
|
+
|
|
290
|
+
Tickets may carry two listing-time facts outside `revision`: `resolvedAt`, the
|
|
291
|
+
ISO-8601 time the ticket entered its completed state (only when `resolved`),
|
|
292
|
+
and `targetTitle`, the target node's title (only beside `target`). Return them
|
|
293
|
+
when your read already has them. The hosted PostgreSQL source records
|
|
294
|
+
`resolvedAt` when a ticket enters the done state, uses the last update for done
|
|
295
|
+
tickets that predate it, and projects `targetTitle` in its listing statements.
|
|
296
|
+
GitHub reports `closed_at` for completed issues and the parent title it reads
|
|
297
|
+
for targeting; Linear reports `completedAt` (or `canceledAt`) and the parent's
|
|
298
|
+
title. The file source reports no `resolvedAt`; operator listings fill a
|
|
299
|
+
missing `targetTitle` from tickets already listed, then with one `get` per
|
|
300
|
+
remaining parent.
|
|
301
|
+
|
|
275
302
|
Search is an optional API 1.11 ticket-source capability:
|
|
276
303
|
`search?(query: TicketSearchQuery): Promise<TicketSearchPage>`. It matches
|
|
277
304
|
every query word against titles and bodies, filters by state and labels, and
|
package/docs/troubleshooting.md
CHANGED
|
@@ -138,6 +138,21 @@ A step the invocation deadline defers is not a failure:
|
|
|
138
138
|
|
|
139
139
|
See [Vercel sandbox recovery](configuration.md#vercel-sandbox).
|
|
140
140
|
|
|
141
|
+
A ticket preparation the invocation deadline carries is not a failure either:
|
|
142
|
+
|
|
143
|
+
- The dispatch log names the ticket: `ticket <id>: preparation carried by the invocation budget`.
|
|
144
|
+
- The tick counts it as `preparationsCarried`, and the `stages:` line shows it, for example `tickets 0/22 carried FLINT-1490`.
|
|
145
|
+
- The ticket isn't handed back to Ready and no other pass claims it. The next invocation prepares it first, before settlement.
|
|
146
|
+
- Don't retry, move or re-file the ticket.
|
|
147
|
+
|
|
148
|
+
## A ticket is carried on several invocations in a row
|
|
149
|
+
|
|
150
|
+
**Symptom.** The same ticket logs `preparation carried by the invocation budget` on several invocations in a row, and no build is created.
|
|
151
|
+
|
|
152
|
+
**Cause.** The deadline keeps cutting its preparation even though it runs first, so one preparation outlasts the hosted invocation budget. The usual culprit is a slow tracker claim or spec authoring.
|
|
153
|
+
|
|
154
|
+
**Action.** Report it to the instance operator with the stage the carry line names, such as `(claim)`. Retrying the ticket doesn't help.
|
|
155
|
+
|
|
141
156
|
## A build stays STARTING with repeated deferral lines
|
|
142
157
|
|
|
143
158
|
**Symptom.** The same build logs `resume`, `provision` or `launch deferred by the invocation budget` on several invocations in a row, and stays STARTING.
|
package/docs/workspaces.md
CHANGED
|
@@ -114,7 +114,7 @@ Sandbox preparation order:
|
|
|
114
114
|
5. `commands.setup`
|
|
115
115
|
|
|
116
116
|
- **Runtimes.** Every primary and alternate runtime needs a pinned install and exact-version preflight, and gets only the credentials named in `environmentVariables`, except declared [accounts](configuration-overview.md#accounts), whose credentials remain on the host and are brokered by egress policy using guest placeholders.
|
|
117
|
-
- **Repetition.** New sandboxes repeat provisioning and preflights rerun before each build-runner; keep setup idempotent.
|
|
117
|
+
- **Repetition.** New sandboxes repeat provisioning and preflights rerun before each build-runner. A failing preflight installs that runtime in place first, so a `[roles]` change reaches existing sandboxes at their next launch; keep setup and runtime installs idempotent.
|
|
118
118
|
- **Resumption.** A provision cut off by a dispatcher teardown resumes in place on the next invocation, at the commit it cloned. Stages already completed with unchanged inputs (checkout, Bun, each `provisioning` step, distribution, dependencies, runtime installs) are skipped; a stage whose inputs changed reruns with every stage after it.
|
|
119
119
|
- **Timeouts.** Each `provisioning` step runs under its `timeoutSeconds` (default 600 s, at most 840 s); Bun, distribution, dependency and runtime stages have fixed bounds. The sandbox kills a step that overruns, and provisioning fails with the stage, command, elapsed time and output so far, charged like any infrastructure failure. A dispatcher teardown instead abandons the stage uncharged and names it, with its elapsed time, in `dispatch.failed`.
|
|
120
120
|
- **Validation.** `bun ab init --validate` runs named provisioning, setup, runtime and Store checks in a disposable environment, deletes it even on failure, and starts no build. For every declared account, including unused accounts, it runs a tool-free model probe through the account's runtime (Claude Code for Claude/Kimi, Codex for ChatGPT); these probes create no ordinary build phase or persistent agent session. Hosted ChatGPT, Claude and Kimi project secrets report readiness from write-only status metadata instead; the first hosted build is the live check.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@defrex/autobuild",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.19.0",
|
|
4
4
|
"description": "Agent-driven software delivery from groomed ticket to merged PR",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -144,7 +144,7 @@
|
|
|
144
144
|
"prepare": "husky",
|
|
145
145
|
"test": "bun tools/test-temp-leaks.ts unit",
|
|
146
146
|
"test:integration": "bun tools/test-temp-leaks.ts integration",
|
|
147
|
-
"typecheck": "node --max-old-space-size=
|
|
147
|
+
"typecheck": "node --max-old-space-size=8192 ./node_modules/typescript/bin/tsc --noEmit",
|
|
148
148
|
"ui:catalog": "bun packages/ui/scripts/catalog.ts",
|
|
149
149
|
"ui:tokens": "bun packages/ui/scripts/tokens.ts",
|
|
150
150
|
"ui:web": "bun packages/ui/scripts/web.ts"
|
|
@@ -162,8 +162,8 @@
|
|
|
162
162
|
},
|
|
163
163
|
"devDependencies": {
|
|
164
164
|
"@biomejs/biome": "2.5.5",
|
|
165
|
-
"@defrex/autobuild-postgres-store": "1.
|
|
166
|
-
"@defrex/autobuild-vercel-sandbox": "1.
|
|
165
|
+
"@defrex/autobuild-postgres-store": "1.19.0",
|
|
166
|
+
"@defrex/autobuild-vercel-sandbox": "1.19.0",
|
|
167
167
|
"@resvg/resvg-js": "2.6.2",
|
|
168
168
|
"@types/bun": "^1.3.14",
|
|
169
169
|
"@types/node": "^24.0.0",
|