@defrex/autobuild 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/README.md +5 -13
  2. package/SPEC.md +140 -10
  3. package/bin/ab-dispatch-generation.ts +11 -2
  4. package/docs/accounts.md +119 -0
  5. package/docs/agent-runtimes.md +4 -4
  6. package/docs/architecture.md +107 -8
  7. package/docs/build-store.md +3 -41
  8. package/docs/cli.md +14 -0
  9. package/docs/configuration-overview.md +111 -0
  10. package/docs/configuration.md +260 -141
  11. package/docs/dispatcher-hosting.md +18 -33
  12. package/docs/intake.md +2 -0
  13. package/docs/merge-policy.md +1 -3
  14. package/docs/operating.md +1 -2
  15. package/docs/operator-api.md +100 -47
  16. package/docs/operator-surfaces.md +3 -20
  17. package/docs/overview.md +1 -1
  18. package/docs/plugin-authoring.md +21 -0
  19. package/docs/remote-store-protocol.md +198 -89
  20. package/docs/remote-ticket-protocol.md +29 -49
  21. package/docs/seams.md +8 -8
  22. package/docs/setup.md +34 -129
  23. package/docs/ticket-sources.md +18 -0
  24. package/docs/troubleshooting.md +7 -11
  25. package/docs/upgrading.md +1 -1
  26. package/docs/workspaces.md +4 -4
  27. package/package.json +14 -5
  28. package/packages/core/src/accounts/chatgpt-oauth.ts +216 -0
  29. package/packages/core/src/accounts/chatgpt-state.ts +41 -0
  30. package/packages/core/src/accounts/local-credentials.ts +194 -0
  31. package/packages/core/src/accounts/local-inference.ts +106 -0
  32. package/packages/core/src/accounts/local-owner.ts +123 -0
  33. package/packages/core/src/accounts/sensitive.ts +2 -0
  34. package/packages/core/src/cli/accounts.ts +147 -0
  35. package/packages/core/src/cli/binary.ts +3 -1
  36. package/packages/core/src/cli/connect.ts +3 -3
  37. package/packages/core/src/cli/dispatch-handoff.ts +125 -44
  38. package/packages/core/src/cli/dispatch-launch-contract.ts +187 -0
  39. package/packages/core/src/cli/dispatch-launcher.ts +54 -21
  40. package/packages/core/src/cli/dispatch-preflight.ts +6 -1
  41. package/packages/core/src/cli/dispatch.ts +71 -2
  42. package/packages/core/src/cli/help.ts +16 -0
  43. package/packages/core/src/cli/init-readiness-remote.ts +22 -1
  44. package/packages/core/src/cli/init-readiness-shared.ts +5 -1
  45. package/packages/core/src/cli/init-validation.ts +160 -18
  46. package/packages/core/src/cli/main.ts +44 -0
  47. package/packages/core/src/cli/publication-settlement.ts +4 -1
  48. package/packages/core/src/cli/secrets.ts +173 -0
  49. package/packages/core/src/cli/store-opening.ts +11 -1
  50. package/packages/core/src/cli/upgrade-agent.ts +9 -1
  51. package/packages/core/src/cli/watch.ts +3 -1
  52. package/packages/core/src/config/accounts.ts +101 -0
  53. package/packages/core/src/config/live.ts +14 -1
  54. package/packages/core/src/config/roles.ts +54 -3
  55. package/packages/core/src/config/schema.ts +60 -0
  56. package/packages/core/src/events/compatibility.ts +2 -1
  57. package/packages/core/src/events/payloads.ts +3 -0
  58. package/packages/core/src/events/repository.ts +2 -0
  59. package/packages/core/src/kernel/__snapshots__/reducer-accumulator-shapes.json +3 -0
  60. package/packages/core/src/kernel/reducer.ts +4 -1
  61. package/packages/core/src/operator/index.ts +2 -0
  62. package/packages/core/src/operator/protocol.ts +6 -0
  63. package/packages/core/src/operator/registry.ts +22 -1
  64. package/packages/core/src/operator/tickets.ts +25 -4
  65. package/packages/core/src/plugins/manifest.ts +2 -1
  66. package/packages/core/src/ports/runner/account-env.ts +88 -0
  67. package/packages/core/src/ports/runner/chatgpt-provider.ts +85 -0
  68. package/packages/core/src/ports/runner/claude.ts +26 -2
  69. package/packages/core/src/ports/runner/codex.ts +63 -31
  70. package/packages/core/src/ports/runner/one-shot.ts +2 -0
  71. package/packages/core/src/ports/runner/provider-error.ts +5 -0
  72. package/packages/core/src/ports/runner/routing.ts +35 -4
  73. package/packages/core/src/ports/tickets/contract.ts +58 -0
  74. package/packages/core/src/ports/tickets/tree.ts +1 -1
  75. package/packages/core/src/ports/types.ts +28 -7
  76. package/packages/core/src/ports/workspace/account-policy.ts +72 -0
  77. package/packages/core/src/ports/workspace/build-execution.ts +6 -1
  78. package/packages/core/src/ports/workspace/builtin-capabilities.ts +1 -0
  79. package/packages/core/src/ports/workspace/create.ts +2 -0
  80. package/packages/core/src/ports/workspace/git-worktree.ts +6 -1
  81. package/packages/core/src/ports/workspace/provider-capabilities.ts +1 -0
  82. package/packages/core/src/ports/workspace/vercel-sandbox.ts +125 -35
  83. package/packages/core/src/processes/build-runner.ts +32 -1
  84. package/packages/core/src/processes/dispatcher.ts +23 -0
  85. package/packages/core/src/processes/execution-settlement.ts +21 -3
  86. package/packages/core/src/processes/harvest-runner.ts +68 -8
  87. package/packages/core/src/project-secrets.ts +105 -0
  88. package/packages/core/src/secret-name.ts +41 -0
  89. package/packages/core/src/store/account-redaction.ts +156 -0
  90. package/packages/core/src/store/contract.ts +3 -1
  91. package/packages/core/src/store/reducer-value-shapes.json +2889 -2781
  92. package/packages/core/src/store/remote/client.ts +42 -47
  93. package/packages/core/src/store/remote/compatibility.ts +18 -0
  94. package/packages/core/src/testing/dispatch-read-budget.ts +122 -0
  95. package/packages/core/src/testing/index.ts +1 -0
  96. package/packages/core/src/testing/reduced-read-budget.ts +47 -0
  97. package/skills/guide/SKILL.md +120 -30
  98. package/skills/guide/references/accounts.md +119 -0
  99. package/skills/guide/references/merge-policy.md +1 -3
  100. package/skills/guide/references/operator-api.md +100 -47
  101. package/skills/guide/references/plugin-authoring.md +21 -0
  102. package/skills/guide/references/remote-store-protocol.md +198 -89
  103. package/skills/guide/references/remote-ticket-protocol.md +29 -49
  104. package/skills/guide/references/setup.md +34 -129
  105. package/skills/harvest/SKILL.md +3 -1
  106. package/skills/harvest-review/SKILL.md +3 -1
  107. package/skills/operate/SKILL.md +5 -6
  108. package/skills/spec/SKILL.md +1 -1
  109. package/skills/tickets/SKILL.md +3 -2
  110. package/templates/hosted-service/package.json +2 -2
  111. package/docs/hosted-dispatcher-cutover-validation.md +0 -178
  112. package/docs/hosted-dispatcher.md +0 -278
  113. package/docs/hosted-service.md +0 -304
  114. package/docs/mcp.md +0 -150
@@ -29,9 +29,7 @@ and re-finalization until hold or completion; it approves the merge rather than
29
29
  an immutable diff. Accepted node reparenting revokes it. Commands and receipts
30
30
  are sequence-correlated: hold acknowledgement confirms native cancellation;
31
31
  merge acknowledgement does not claim gates passed. MCP/operator tools offer the
32
- same actions; the terminal uses `l`/`o`. The hosted web app offers **Merge** and
33
- **Hold** on a merge awaiting consent. These controls record the same durable
34
- actions; **Merge** does not mean the merge gates have passed.
32
+ same actions; the terminal uses `l`/`o`. These controls record durable actions; merge consent does not mean the merge gates have passed.
35
33
 
36
34
  ## Worked configurations
37
35
 
package/docs/operating.md CHANGED
@@ -17,7 +17,7 @@ Your operator agent keeps work moving through `ab` or MCP. Under your instructio
17
17
  ## Choose a harness
18
18
 
19
19
  - **A local coding agent** at the repository root with the installed `ab-operate` skill, using the CLI or `bun ab mcp` (operator tools over stdio).
20
- - **A remote agent** with no checkout, on the authenticated hosted `/mcp` endpoint. See [Operator surfaces](operator-surfaces.md).
20
+ - **An API client** using the authenticated [Operator API contract](operator-api.md).
21
21
 
22
22
  We recommend the same model as your reviewer roles, since the agent interprets findings and escalation answers.
23
23
 
@@ -125,7 +125,6 @@ Every surface reads the same durable state; [Operator surfaces](operator-surface
125
125
  | Surface | Progress, escalations, pause/resume | Merge consent and hold |
126
126
  |---|---|---|
127
127
  | Terminal dashboard (`bun ab dispatch`) | Yes | Keys `l` (merge) and `o` (hold) |
128
- | Hosted web app | Yes, plus sessions and transcripts | Merge/Hold on a merge awaiting consent |
129
128
  | CLI and MCP operator tools | Yes | Yes |
130
129
 
131
130
  ## An example session
@@ -1,6 +1,7 @@
1
1
  # Operator API v1
2
2
 
3
- The hosted service exposes the polling-oriented operator surface at
3
+ A conforming hosted instance implements this normative polling-oriented operator
4
+ contract at
4
5
  `/operator/v1/repos/{repo}`. It is versioned with remote store protocol **6**.
5
6
  Every request must send `X-Autobuild-Version`,
6
7
  `X-Autobuild-Protocol-Version: 6`, and `Authorization: Bearer …`. Identity is
@@ -14,29 +15,26 @@ every request. Revocation takes effect on the next request without affecting
14
15
  other credentials. Unknown, expired or revoked credentials receive `401 auth`;
15
16
  removed projects receive `403 auth` with `project not registered`.
16
17
 
17
- The deployment owner runs these commands locally with database access:
18
-
19
- ```sh
20
- ab-hosted-store credentials issue https://github.com/acme/app --user owner@example.com
21
- ab-hosted-store credentials list https://github.com/acme/app
22
- ab-hosted-store credentials revoke https://github.com/acme/app --id ID --user owner@example.com
23
- ```
24
-
25
- Issue prints the secret once; list contains metadata only. Issue optionally
26
- accepts `--ttl-seconds N` or `--expires-at ISO-8601`. For administrative/non-interactive issuance, set the returned token as
27
- `AB_TOKEN`. Interactive project onboarding uses `ab connect <service-url>`;
28
- it saves the credential outside the repository and commits no secret. Previous `AB_TOKEN` values and `mint operator` / `mint build` are
29
- retired: the service responds that the credential format changed and points
30
- to `credentials issue`. Supported old protocol shapes still work with a new
31
- credential; protocol compatibility does not restore retired authentication.
32
-
33
- `mint admin --ttl-seconds N` creates an explicit versioned, attributed owner
34
- break-glass credential. It can cross project boundaries. Keep it owner-only:
35
- never give it or `AB_STORE_SECRET` to a dispatcher or build agent.
18
+ The hosted cron dispatcher issues a dispatcher-purpose credential per repository
19
+ tick, then deletes that exact row on completion or failure. Its crash-safety
20
+ expiry is capped at the invocation deadline plus 60 seconds and the configured
21
+ `AB_DISPATCHER_TOKEN_TTL_SECONDS` upper bound. Each served tick removes at most
22
+ 100 expired or revoked dispatcher rows through indexed probes. Legacy unexpired
23
+ rows keep their recorded expiry and are pruned afterward. Owner lifetimes are
24
+ unchanged. Build and harvest grants are independent signed authority, governed
25
+ by durable lifecycle facts and the existing evidence grace, not parent credential
26
+ storage or TTL; agents never receive the cron credential.
27
+
28
+ Obtain a project credential with `ab connect <instance-url>` or from the
29
+ instance, and use `AB_TOKEN` on non-interactive clients. Interactive connection
30
+ saves the credential outside the repository. Retired credential formats are
31
+ refused with a credential-format-changed diagnostic; supported old protocol
32
+ shapes still require current credentials. Compatibility does not restore retired
33
+ authentication. Versioned, attributed owner-admin credentials are an explicit
34
+ cross-project exception and must never be supplied to build agents.
36
35
 
37
36
  Owner-purpose project credentials attribute every write to their recorded creator.
38
- Dispatcher-purpose credentials are refused. Signed-in owners in the dashboard
39
- and MCP receive short-lived internal signatures with an explicit version,
37
+ Dispatcher-purpose credentials are refused. Internal operator credentials use short-lived internal signatures with an explicit version,
40
38
  selected repository, signed user, expiry and MCP `via`. Only the service holds
41
39
  the signing key. These signatures authorize operator routes only and require a
42
40
  registered project; replay against another project is refused.
@@ -46,13 +44,12 @@ tool execution. Body repositories and secondary build/session identifiers are
46
44
  also checked inside that project. Explicit project mismatches return `403 auth:
47
45
  wrong project`; removal returns `403 auth: project not registered`. Encode each
48
46
  repository, build, session and artifact kind as a separate URL path segment.
49
- Registration changes use the database-local `projects list|add|remove` owner
50
- commands; see [owner workflow](setup.md#connected-projects).
47
+ Registration is instance-owned; project credentials cannot administer it.
51
48
 
52
49
  ## Operator sessions
53
50
 
54
51
  Operator sessions are the signed-in user's durable orchestrator
55
- conversations: a hosted-only third store resource. A session
52
+ conversations: a third store resource. A session
56
53
  belongs to the user who created it; other members of the same repository
57
54
  can read it and cannot write to it (`403 auth` on non-owner writes). Every
58
55
  write is attributed to the token's signed user — never a client-supplied
@@ -91,7 +88,7 @@ raw session-event append. External operator harnesses own agent execution.
91
88
  | `GET …/status` | Repository intake, pause, and default-auto-merge projection. |
92
89
  | `GET …/harvest/status` | Harvest gate, runs, steps, recovery, and attention projection. |
93
90
  | `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. |
94
- | `GET …/tickets?state=S&label=L` | `{states,tickets,diagnostics,criteria,triageState,readyState}`. The two 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. |
91
+ | `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 source order, the default) or `newest`; `total` counts every match before paging. |
95
92
  | `GET …/tickets/states` | Full state metadata `{name,tickets,about?}[]`, including empty states (`tickets.states` in MCP). |
96
93
  | `GET …/tickets/{id}` | `{ticket,blockers,build}`. Blockers include native `exists`/`resolved` status; `build` prefers an active matching repository build, otherwise the most recently updated one. |
97
94
 
@@ -110,7 +107,7 @@ MCP presence registration is deferred. `ab watch`
110
107
  streams build and repository events by polling the same event logs client-side
111
108
  (the store protocol's `GET /builds/{slug}/events` and `GET /repos/{repo}/events`
112
109
  reads), not as a transport on this API. `triageState`, `readyState`,
113
- and every entry in `states` are backend state names and must be sent back verbatim
110
+ `doneState`, and every entry in `states` are backend state names and must be sent back verbatim
114
111
  when used with the move control.
115
112
 
116
113
  ## Controls
@@ -148,7 +145,7 @@ The retry object is deliberately bare: adding `text` is a `400 validation`
148
145
  rather than silently changing the resolution to guidance. A revision object may
149
146
  also carry `ceiling` only to receive the shared `incompatible-answer-options`
150
147
  refusal; a ceiling and spec revision cannot be performed together.
151
- The hosted service has no ticket-provider credentials. For ticket-origin
148
+ The protocol does not supply ticket-provider credentials. For ticket-origin
152
149
  revision, a trusted caller fetches the current ticket body and supplies it; the
153
150
  build must still have a recorded ticket. Revision conformance, lazy retry,
154
151
  artifact metadata, event ordering, and refusal rules are the same as the CLI.
@@ -174,8 +171,7 @@ restart from `plan`.
174
171
  ## The registry's protocol face: `POST …/tools/{tool}`
175
172
 
176
173
  One generic route executes any entry of the agent tool registry (the same
177
- closed table `ab mcp` serves over stdio and the hosted `/mcp` endpoint serves
178
- over Streamable HTTP): the body is the tool's validated input — `repo`
174
+ closed table `ab mcp` serves over stdio): the body is the tool's validated input — `repo`
179
175
  included and required to equal the URL's repository — and the response is the
180
176
  registry result verbatim. The verified operator token supplies the acting
181
177
  identity and, when minted with one, the `via` attribution marker; the body
@@ -222,18 +218,16 @@ progress and unattempted builds. Unexpected failures are `500 internal`.
222
218
 
223
219
  ## Browser gateway
224
220
 
225
- The same deployment serves the web dashboard through `/api/web/repos/{repo}/…`.
221
+ The cookie-authenticated gateway contract uses `/api/web/repos/{repo}/…`.
226
222
  That route is not a second public bearer-token API: it requires a current
227
- Better Auth HTTP-only cookie, rechecks the deployment current organization membership and project registration, rejects cross-origin JSON controls, and delegates only the dashboard,
223
+ Better Auth HTTP-only cookie, rechecks the instance’s current organization membership and project registration, rejects cross-origin JSON controls, and delegates only the dashboard,
228
224
  build, settings, and harvest operator suffixes listed above. It replaces caller-supplied authorization/version
229
225
  headers with a server-minted token that expires after 30 seconds and carries
230
226
  the normalized signed-in email. Consequently every durable control event has
231
227
  the browser user's human actor while no token or signing secret reaches client
232
- code. Responses are private/no-store; a 401 sends the application back to sign
233
- in. Browser clients poll the visible dashboard every two seconds; the browser
234
- surface offers no streaming of its own — live transcript streaming remains
235
- absent here, and the streaming read surface is the CLI's `ab watch`, which
236
- polls the store's event reads client-side. Delegated bearer tokens remain
228
+ code. Responses are private/no-store; 401 requires reauthentication.
229
+ Polling clients may use a two-second interval. The gateway provides no
230
+ streaming transport; `ab watch` polls store event reads client-side. Delegated bearer tokens remain
237
231
  server-side.
238
232
 
239
233
  The API does not expose phase-session commands, runner startup, a push or
@@ -387,12 +381,12 @@ ignores old holds. Preflight failure suppression above remains separate.
387
381
  ## Organization management (browser)
388
382
 
389
383
  These same-origin cookie-session routes are the management contract. Mutations
390
- require the exact `BETTER_AUTH_URL` Origin and `application/json`, accept at most
384
+ require the exact configured instance origin as Origin and `application/json`, accept at most
391
385
  8192 characters of JSON, and reject unsupported fields. Responses are private,
392
386
  no-store. No client-supplied actor or role is trusted. Raw Better Auth
393
387
  `/api/auth/organization/*` routes are disabled, including invitations.
394
388
 
395
- ### Discovery and bootstrap
389
+ ### Discovery and creation
396
390
 
397
391
  `GET /api/web/orgs` returns
398
392
  `{isSuperUser,organizations:[{id,name,slug,ownerEmail,membershipRole}]}`.
@@ -403,14 +397,10 @@ Results sort by slug then ID. Members may inspect and read rosters in their own
403
397
  organizations, including member emails. Foreign organizations return 403 before
404
398
  resource detail. A multi-org member uses these IDs for explicit connect selection.
405
399
 
406
- To bootstrap, sign in as a super user configured by
407
- `AB_WEB_SUPER_USER_EMAILS`, then POST `{name,slug}` to `/api/web/orgs`.
400
+ Only super users may POST `{name,slug}` to `/api/web/orgs`.
408
401
  The response is 201 `{organization}` in the discovery shape. Names are nonblank
409
402
  and at most 100 characters; slugs are unique lowercase kebab strings of at most
410
- 100 characters. Creation grants no membership. The account menu links every
411
- operator to `/members`, and super users to `/organizations` and `/projects`.
412
- These separate pages show acknowledged reads, refresh after writes, and confirm
413
- member removal and project moves inline before writing.
403
+ 100 characters. Creation grants no membership.
414
404
 
415
405
  Super users and the organization’s members can GET `/api/web/orgs/:orgId` for
416
406
  `{organization,projects:[repo]}` with active owned projects and the caller’s actual
@@ -447,5 +437,68 @@ the inactive project; re-registration restores that assignment.
447
437
  Status codes are 401 for absent, malformed or expired sessions; 403 for admission
448
438
  or role refusal; 400 for invalid inputs; 404 for missing resources after role
449
439
  checks; 409 for duplicate slugs; and sanitized 503 for store outages. Foreign
450
- projects return the same unknown-repository result as absent projects. Machine
451
- credentials and the hosted-store administration CLI keep their existing behavior.
440
+ projects return the same unknown-repository result as absent projects. Machine credentials retain their separate authority.
441
+
442
+
443
+ ### Permanent project deletion
444
+
445
+ Super users and the owner of a project's organization can delete it from the
446
+ Projects page. Owners see only projects in organizations they own; Move and
447
+ Assign remain super-user operations. The shared confirmation dialog names the project,
448
+ shows current build, hosted ticket, secret and subscription-account counts, and
449
+ requires a second, destructive action. Local files and configuration are unaffected.
450
+
451
+ Authenticated human sessions can use `GET /api/web/projects/deletion?repo=<encoded repository>`
452
+ for the authorized preview. It returns `repo`, an opaque `token`, `builds`,
453
+ `tickets`, `secrets`, and `subscriptionAccounts`. Send that token unchanged in
454
+ `If-Match` to `DELETE /api/web/projects/deletion`, with exactly `{repo}` as JSON.
455
+ The write requires the configured same origin. Missing tokens return 428;
456
+ a token for another live generation returns 412 without changing anything.
457
+ A token for an already-deleted generation is an idempotent no-op, including after
458
+ reconnection, for the initiating actor or a super user. Success returns
459
+ `{deleted:true}` only after cleanup completes. Unauthorized callers receive no counts.
460
+
461
+ Deletion cuts off access before purging builds, events, sessions, streams,
462
+ artifacts, hosted tickets and assets, secrets, subscription accounts, credentials,
463
+ connections, presence and organization assignment. Blobs another project references
464
+ or reserves survive. The only retained project record contains the repository,
465
+ initiating actor, deletion time and one opaque generation id. Provider failure
466
+ leaves access refused and durable cleanup pending. The Projects page lists
467
+ unfinished deletions with a **Finish deletion…** action, including after reloading,
468
+ opening another tab or restarting the service. Reopen its confirmation dialog to
469
+ retry cleanup with the original operation's preview token, even though the live
470
+ generation was invalidated at the initial purge. A pending preview returns that
471
+ same original token. Deletion waits only for mutation transactions already holding
472
+ the project generation row, never for an entire HTTP request. Subsequent mutation
473
+ transactions in an admitted request fail with `403 project not registered` and
474
+ roll back; operations committed before the purge remain permissible.
475
+ Cancel only closes the confirmation and does not undo the cutoff.
476
+ `GET /api/web/projects/deletions` returns `{projects: string[]}` for pending
477
+ cleanup authorized to the current owner or super user, including unassigned
478
+ projects for super users. Members and outsiders receive no pending project names.
479
+ This management-only list does not restore projects to builds selectors or normal
480
+ organization discovery. Cleanup commits progress in batches of at most 32 blobs,
481
+ using provider batch deletion where supported; a failed batch remains retryable. Registration is blocked until cleanup
482
+ finishes. Legacy untraceable orphan blobs with no ownership record or retained
483
+ project reference are excluded from deletion.
484
+
485
+ Old credentials return `401` as unknown or revoked, including repository-free
486
+ connection status calls; routes that otherwise establish the repository return
487
+ `403 project not registered`. No credential tombstones are retained. Browser
488
+ approval of a fresh `ab connect` registers an empty project; proposing a connection
489
+ alone does not register it. Old credentials and grants remain invalid. Hosted
490
+ ticket numbering starts again at 1.
491
+
492
+ `ab disconnect` only revokes the saved credential and retains project data.
493
+ The admin `projects remove` command only unregisters access and retains data;
494
+ it is a separate operation from permanent web project deletion.
495
+
496
+
497
+ S3 cleanup requires `s3:DeleteObject`, `s3:ListBucketVersions` and
498
+ `s3:DeleteObjectVersion` for the configured bucket and exact prefixed content
499
+ keys. It removes stored versions and delete markers as well as current objects;
500
+ permission or retention failures leave deletion pending. Vercel Blob cleanup uses
501
+ the same store identity, token and prefixed pathname as uploads. Missing objects
502
+ are successful cleanup; provider errors never count as completed deletion.
503
+
504
+ Paged ticket listings use the source's optional native `listPage(criteria, page)` capability when present, otherwise read the full listing and reverse/slice 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.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  title: "Operator surfaces"
3
3
  group: "reference"
4
- description: "Watch and act through the terminal, web app, CLI, or MCP with your operator agent."
4
+ description: "Watch and act through the terminal, CLI, local stdio MCP, or Operator API with your operator agent."
5
5
  label: "Operator surfaces"
6
6
  order: 12
7
7
  ---
@@ -35,7 +35,7 @@ bun ab build status example-build --json
35
35
  - Interactive `dispatch` shows the terminal dashboard.
36
36
  - A shell-capable agent follows progress and acts through the CLI, including `bun ab watch` and `bun ab wait`.
37
37
  - A standing CLI operator uses `bun ab watch --operator --json` after checking `bun ab repository status --json` for existing presence. It operates the builds the repository's dispatcher dispatches and adopts new ones.
38
- - Presence is advisory, allows multiple registrations, and is not exposed by MCP or the web app. Termination attempts withdrawal; routine timeout/count re-arms keep the five-minute grace. SIGKILL and failed withdrawal rely on TTL expiry.
38
+ - Presence is advisory, allows multiple registrations, and is not exposed by MCP. Termination attempts withdrawal; routine timeout/count re-arms keep the five-minute grace. SIGKILL and failed withdrawal rely on TTL expiry.
39
39
  - Dashboard and API share one lifecycle vocabulary.
40
40
 
41
41
  A local CLI can use a remote Store:
@@ -53,15 +53,6 @@ readyState = "ready"
53
53
 
54
54
  `bun ab connect https://builds.example.com` approves the registered project and saves its credential outside the checkout; CI sets `AB_TOKEN` instead. It authorizes the project only, not forge or runtime access. See [Build store](build-store.md).
55
55
 
56
- ### Web app
57
-
58
- The hosted web app shows registered repositories and their builds.
59
-
60
- - **Sign-in** uses the deployment's GitHub authentication and organization membership policy, independent of CLI credentials.
61
- - **Merge consent:** a merge awaiting consent offers **Merge** and **Hold**. These record durable actions; readiness and merge gates still apply. See [Authorize merge](operating.md#authorize-merge).
62
- - **Appearance:** open the account menu and choose **System**, **Light** or **Dark** under **Theme**. System is the default and follows the OS preference. Your choice is saved for this browser.
63
- - **Secrets** (database, blob, signing, OAuth, super-user list) stay on the service, never in TOML or browser bundles.
64
-
65
56
  ### Local stdio MCP
66
57
 
67
58
  For an agent with an MCP client but no convenient shell, configure the client to launch:
@@ -75,17 +66,9 @@ bun ab mcp
75
66
  - **Phase refusal.** Refuses phase-session `AB_*` authority, including malformed tuples: repository-wide tools can't be narrowed to one phase.
76
67
  - **Attribution.** Sessionless writes use the local user identity, like the CLI.
77
68
 
78
- ### Hosted HTTP MCP
79
-
80
- A remote agent connects its MCP client to `https://builds.example.com/mcp` over Streamable HTTP.
81
-
82
- - **Authentication:** OAuth with discovery, dynamic registration, PKCE and rotating refresh tokens, authorized through the deployment's sign-in and organization membership. `AB_TOKEN` doesn't substitute.
83
- - **Every call** rechecks access and repository scope.
84
- - **Writes** record the authorizing identity and MCP client.
85
-
86
69
  ## Writing your own
87
70
 
88
- There's no operator-surface plugin map. Build a client of the versioned, authenticated Operator API, or connect through MCP.
71
+ There's no operator-surface plugin map. Build a client of the versioned, authenticated Operator API, or launch local stdio MCP.
89
72
 
90
73
  - One registry defines tools, schemas, annotations and execution, keeping CLI, API and MCP at parity.
91
74
  - Follow the API's request, version and authentication requirements; don't scrape dashboard markup.
package/docs/overview.md CHANGED
@@ -12,7 +12,7 @@ slug: ""
12
12
  Autobuild runs coding agents through a fixed pipeline that takes a groomed ticket to a verified pull request, with a separate workspace for each build. Three actors keep that work moving:
13
13
 
14
14
  - **You** decide goals, scope, tradeoffs, and how much authority to delegate.
15
- - **Your operator agent** is an external agent that writes specs, files and grooms tickets, operates the builds the repository's dispatcher dispatches, and answers questions within your instructions. The `ab` CLI is primarily its interface; remote agents use MCP.
15
+ - **Your operator agent** is an external agent that writes specs, files and grooms tickets, operates the builds the repository's dispatcher dispatches, and answers questions within your instructions. The `ab` CLI is primarily its interface; agents without a shell can use local stdio MCP or the Operator API.
16
16
  - **The dispatcher** claims ready work and runs the durable pipeline, including isolated agent sessions, checks, and publication.
17
17
 
18
18
 
@@ -139,6 +139,7 @@ A plugin relying on a capability declares an `apiVersion` range containing its v
139
139
  - **1.5** `path` is the path in the workspace environment; set optional `localPath` only when the dispatcher can reach that same copy directly. Workspace-owned executors receive the durable provider locator as `BuildExecutionStart.workspaceRef`; local PID supervision stays host-owned.
140
140
  - **1.7** Workspace factory seams.
141
141
  - **1.8** Forge failure classification and request observers.
142
+ - **1.9** Optional native ticket-source paging (`listPage`); older sources retain operator slicing.
142
143
 
143
144
  ## 2. Create a repository-local module
144
145
 
@@ -424,3 +425,23 @@ An adapter opts in with `integrationTree: true` and must:
424
425
  - expose kind and target in revisions
425
426
 
426
427
  Don't opt in unless the source preserves these semantics. Legacy sources get ordinary CRUD; the compatibility facade refuses metadata writes before legacy methods run, and unsupported sources should also refuse metadata at their own write boundary.
428
+
429
+ ## Optional ticket paging capability
430
+
431
+ Native paging is an optional API 1.9 ticket-source capability:
432
+ `listPage?(criteria: TicketCriteria, page: TicketPage): Promise<TicketPageListing>`.
433
+ The SDK exports these types; the result is `TicketListing & { total: number }`.
434
+ Criteria retain state, labels (AND), and assignee semantics. The page has a
435
+ nonnegative integer `limit`, optional nonnegative integer `offset` (default 0),
436
+ and optional `order: 'oldest' | 'newest'` (default oldest). Newest reverses the
437
+ entire source order before offset and limit. Total counts all matches, even
438
+ with limit zero or an offset past the end. Records, diagnostics and errors
439
+ match the exhaustive listing. The shared `describeTicketSourceContract` suite
440
+ automatically compares declared native paging with full-read windows.
441
+
442
+ Only paged operator listings select this capability. Sources without it retain
443
+ the full-read/reverse/slice fallback; native errors propagate. Unpaged operator
444
+ listings, CLI ticket lists and dispatcher ready scans remain exhaustive through
445
+ `listReady`/`listAll`. The hosted PostgreSQL source counts matches without
446
+ bodies and reads only the SQL-bounded window. File, Linear and the remote
447
+ `HostedTicketSource` retain fallback; the POST list-ready protocol stays exhaustive.