@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
@@ -32,7 +32,7 @@ maintainer before selecting it:
32
32
  - a dispatcher-side push-capable `GITHUB_TOKEN` or `GH_TOKEN`;
33
33
  - for a private repository, a separate read-only clone identity named by
34
34
  `gitUsernameEnv` and `gitPasswordEnv`;
35
- - an HTTPS hosted service reachable from Vercel, configured through `ab connect <url>`;
35
+ - a remote store that speaks the remote BuildStore protocol and is reachable from Vercel, configured through `ab connect <url>`;
36
36
  - each selected role and alternate's runtime/model, its pinned
37
37
  `[workspace.config.runtimeProvisioning.<runtime>]` commands, and the API
38
38
  credential names it needs in `[workspace.config].environmentVariables`.
@@ -67,8 +67,7 @@ preflight = "test \"$(pi --version)\" = \"0.84.4\" && pi update --models"
67
67
  ```
68
68
 
69
69
  Use a `vercel-ai-gateway/...` Pi model with `AI_GATEWAY_API_KEY` in the
70
- dispatcher environment. Do not copy `~/.pi`, OAuth refresh tokens, or any local
71
- runtime auth state, and do not attempt interactive login in a sandbox. Runtime
70
+ dispatcher environment. For Claude Code, configure [accounts](accounts.md) with a manually provisioned `claude setup-token` credential or a Kimi Code membership key; use the unmodified runtime, your own subscription, and ordinary individual usage. ChatGPT subscription accounts use `bun ab accounts login NAME` on your machine with one dispatcher or hosted refresh owner. Pi and ambient Codex login state are not copied, and interactive sandbox login is unsupported. Runtime
72
71
  names are open: a plugin runtime uses the same strict map, for example
73
72
  `[workspace.config.runtimeProvisioning.opencode]`, with its own immutable
74
73
  install and exact-version preflight commands.
@@ -96,7 +95,10 @@ checkout dependencies in every fresh/replacement sandbox and before the
96
95
  readiness probe, writes the marker only after success, and reruns every
97
96
  preflight before each build runner. A failure names the runtime, selecting
98
97
  role/alternate, and field and starts no agent. Runtime provisioning receives
99
- only the API credentials named by `[workspace.config].environmentVariables`.
98
+ allowlisted legacy API credentials named by
99
+ `[workspace.config].environmentVariables` and automatically supplied placeholders
100
+ for every declared account credential variable. Account variables need no
101
+ allowlist entry; their real credentials remain on the dispatcher host.
100
102
 
101
103
  Keep package-level and checkout-level bootstrap in an idempotent
102
104
  `[commands].setup`. It runs after system provisioning and must remain safe to
@@ -156,7 +158,7 @@ to `workspace.config.provisioning` (or a package dependency to setup) while
156
158
  retaining the universal image; add a runtime credential name to
157
159
  `environmentVariables` and its value to the dispatcher environment; correct the
158
160
  Vercel team/project credential set; provide separate private-clone credentials;
159
- use an HTTPS GitHub origin and hosted Store; authorize the Store token; or commit
161
+ use an HTTPS GitHub origin and remote Store; authorize the Store token; or commit
160
162
  and push the selected base branch.
161
163
 
162
164
  ## Keep per-build records in separate fragments
@@ -183,7 +185,7 @@ shared edit surface; the repository owns the release-time assembly tooling.
183
185
  ## Repository identity is the origin, not a checkout path
184
186
 
185
187
  Repository identity in the Store, dispatcher, `ab builds`, `ab build status`,
186
- `ab repository status`, and the web app is the repository's **normalized origin
188
+ `ab repository status` is the repository's **normalized origin
187
189
  URL** (`https://github.com/owner/repository`), not a checkout's absolute path.
188
190
  Two checkouts of the same repository — on different hosts, or a dispatcher and
189
191
  its sandboxes — agree on one identity.
@@ -245,15 +247,14 @@ sources agree with the running system by construction:
245
247
  runs the dispatcher's own code.
246
248
  - **Origin mode** (checkout-less dispatcher): the guest archive is the release
247
249
  asset `autobuild-<version>.tgz` fetched from the canonical repository at the
248
- **running dispatcher's version** (read from the deployed distribution's
250
+ **running dispatcher's version** (read from the installed distribution's
249
251
  `package.json`), so the guest runs the dispatcher's own release.
250
252
 
251
253
  A service accepts stable and prerelease clients from its own `major.minor`
252
254
  release line and the two preceding minor lines in the same major. A major starts a new family:
253
255
  X.0 accepts only X.0, X.1 accepts X.0/X.1, and X.2 onward accepts three lines.
254
256
  Patch versions are interchangeable in both directions and must never change
255
- the protocol. Upgrade the service first, then projects independently within
256
- its window. Supported release lines retain their wire handlers and known
257
+ the protocol. Keep project clients within the instance’s published window. Supported release lines retain their wire handlers and known
257
258
  protocol identities; an unknown protocol is refused independently of version.
258
259
  Stable and prerelease service and client identities share their numeric major/minor
259
260
  line. Malformed or missing identities, build metadata (`+…`), prefixes and
@@ -274,11 +275,12 @@ It warns and continues when the target is outside the range, naming the
274
275
  required service upgrade for a newer target or a compatible project range for
275
276
  an older one. An unavailable or malformed probe warns that connectivity may
276
277
  fail after upgrade. Legacy health without a range means exact-version matching;
277
- upgrade that service to the compatibility-window release first.
278
+ the hosted instance must publish a compatibility window before clients can
279
+ use release-line compatibility.
278
280
 
279
281
  A distribution fix reaches origin-mode guests after a release is cut and the
280
282
  dispatcher is upgraded. Guests continue to run the dispatcher's own version;
281
- the hosted service must support that release line.
283
+ the instance must support that release line.
282
284
 
283
285
  Provisioning records the installed distribution's identity — package version
284
286
  and remote-store protocol version — in the guest's
@@ -305,29 +307,20 @@ perspective:
305
307
  Local `git-worktree` dispatch keeps working from a checkout exactly as before;
306
308
  apart from the identity change, `ab dispatch` behaves as it did.
307
309
 
308
- ## Hosted deployment variables
309
-
310
- A hosted-store deployment configures its web/auth variables once — see the
311
- hosted service README and the complete environment reference in the pinned
312
- distribution checkout: `BETTER_AUTH_URL`, `AB_WEB_SUPER_USER_EMAILS`,
313
- and the optional `AB_WEB_MCP_RESOURCE` — the protected
314
- resource the hosted MCP server (docs/mcp.md) binds its OAuth tokens to,
315
- defaulting to `<BETTER_AUTH_URL>/mcp`. Set it only when a proxy or custom
316
- domain fronts the deployment under a different public URL than
317
- `BETTER_AUTH_URL`; the value must be an absolute http(s) URL (https in
318
- production) or every MCP client's discovery binds tokens to the wrong
319
- resource.
320
-
321
-
322
310
  ## Connect a project
323
311
 
324
312
  From a checkout with an origin remote, run `ab connect https://YOUR_ORIGIN`.
325
313
  The CLI prints a verification URL and short code and attempts to open a browser.
326
- Sign in as an allowed owner, check the full repository identity and code, and
327
- approve or deny. Another device can open the printed URL, or visit `/connect`
328
- and enter the code. Approval requires the web-enabled service origin; a
329
- standalone machine-only listener cannot present browser consent. Requests
330
- expire after ten minutes. Denial and timeout leave local configuration unchanged.
314
+ The code link opens approval directly; if sign-in is needed, it returns there.
315
+ Check the full repository identity and code, and approve or deny. For an
316
+ unassigned project, choose an eligible organization; a sole option is visibly
317
+ selected. Approval requires that destination even for previously registered
318
+ unassigned projects. Assigned projects show their organization as read-only;
319
+ moving them uses project management. With no eligible organization, approval is
320
+ unavailable until a super user creates one. Another device can open the printed
321
+ URL, or visit `/connect` and enter the code. Approval uses the instance’s browser
322
+ consent endpoint. Requests expire after ten minutes. Denial requires no
323
+ organization choice; denial and timeout leave local configuration unchanged.
331
324
 
332
325
  On approval the service registers the project and issues a project credential.
333
326
  The CLI keeps it in `$XDG_CONFIG_HOME/autobuild/credentials` (or
@@ -359,55 +352,6 @@ saved credential for CI and other non-interactive hosts. A service override
359
352
  never borrows another service's credential. Build and harvest sessions keep
360
353
  their explicit scoped authority.
361
354
 
362
- ## Connected projects
363
-
364
- Migrate PostgreSQL from the pinned release before deploying (`bun run
365
- postgres:migrate`). The service keeps an independent, durable project registry;
366
- existing build or ticket data does not register a project. An administrator
367
- with deployment database credentials manages it without redeploying:
368
-
369
- ```sh
370
- ab-hosted-store projects list
371
- ab-hosted-store projects add https://github.com/owner/project --user owner@example.com
372
- ab-hosted-store projects remove https://github.com/owner/project --user owner@example.com
373
- ```
374
-
375
- From a source checkout, substitute `bun packages/hosted-store-service/src/bin.ts`
376
- for `ab-hosted-store`. Configure `AB_POSTGRES_URL` or `DATABASE_URL` in that
377
- process. Database possession grants administration; `--user` is declared audit
378
- attribution, not a verified login. Ordinary project/store tokens cannot manage
379
- registrations. Each entry records the normalized origin URL, addition time,
380
- and adding identity. SSH git spellings normalize to HTTPS; local paths and
381
- credential-bearing HTTPS URLs are rejected. Duplicate adds preserve metadata;
382
- remove is idempotent, and re-adding records a fresh addition.
383
-
384
- Super users can operate every registered project. Organization members can
385
- operate only active projects assigned to their organizations; legacy unassigned
386
- projects are visible only to super users. Membership is granted by normalized
387
- email, including before first sign-in, and is rechecked on every request. The dashboard,
388
- MCP discovery and calls, and every operator API route consult current
389
- registration. Removal hides a project from all these surfaces and subsequent
390
- hosted dispatcher invocations; builds, events, artifacts and tickets remain,
391
- and re-registration restores access. Already-started work is not cancelled.
392
- Project credentials issued by connect authorize only their registered project. Administrative credential issuance remains available for non-interactive hosts.
393
-
394
- Link directly to `/?repo=<URL-encoded normalized origin>`. The page selects the
395
- first registered origin when the requested one is missing or removed, and an
396
- empty registry shows no project data or controls. Registry errors fail closed;
397
- there is no environment fallback on database failure.
398
-
399
- `AB_WEB_REPOSITORIES` is deprecated. A nonempty CSV is imported exactly once per
400
- database, on the first registry initialization with that variable configured,
401
- with actor `system:AB_WEB_REPOSITORIES`. The import and durable marker commit
402
- atomically across concurrent starts. An absent variable does not consume the
403
- marker. Later restarts or edits to the variable never re-add removed projects;
404
- use the owner commands for subsequent administration.
405
-
406
- The hosted dispatcher queries current registrations on every authorized
407
- invocation. With `AB_DISPATCHER_REPOSITORIES` unset, it serves all registered
408
- projects; an explicit list preserves its order and is intersected with current
409
- registration. An empty registry is a successful zero-project invocation.
410
-
411
355
  ## Authoring an agent verifier
412
356
 
413
357
  A repository-owned agent-verify skill is a verifier, not a reviewer: it drives
@@ -480,45 +424,8 @@ cannot select another project. See [local builds with hosted tickets](#local-bui
480
424
 
481
425
  The service never contacts Linear. Projects with external sources (including
482
426
  file and Linear) keep using those sources directly through their dispatcher;
483
- service ticket HTTP, operator and MCP surfaces refuse with project/source
484
- feedback rather than returning an empty queue. Removed `AB_TICKET_BACKEND` and
485
- `LINEAR_API_KEY` values are ignored with one startup removal message, including
486
- blank/unknown values. Removed `AB_TICKET_TRIAGE_STATE`, `AB_TICKET_READY_STATE`,
487
- `AB_TICKET_DOING_STATE` and `AB_TICKET_DONE_STATE` values are ignored even when
488
- malformed. None of these retired settings prevents startup.
489
-
490
- The environment-aware migration imports `AB_WEB_REPOSITORIES` once before
491
- ownership preflight, including released main-v9 deployments without registry
492
- tables. A failed migration rolls back the import, main-schema promotion and
493
- ticket changes together. Owner `projects add` and `tickets assign-team` commands
494
- bootstrap only the registry/recovery journals and work while the main marker
495
- is still v9. Without the retired environment, first register the intended
496
- project with `ab-hosted-store projects add REPOSITORY --user IDENTITY`, then
497
- assign the team and rerun migration. A successful one-time import is never
498
- reapplied from later environment edits.
499
-
500
- Ticket schema v1 migration assigns each whole legacy team to its sole claimant
501
- among registered projects' latest effective configs, reading their actual blob
502
- bytes. Projects with no dispatcher run or no effective-config reference make
503
- no team claim and do not block other projects. Unclaimed teams still fail closed.
504
- When inferring ownership, a selected configuration whose revision/blob is missing,
505
- unreadable or invalid stops unchanged with recovery guidance. Restore the selected
506
- configuration or assign every remaining legacy team explicitly; complete owner
507
- assignments to registered projects bypass unrelated configuration reads. Conflicts
508
- and asset ownership mismatches also stop unchanged. Resolve ownership, then rerun:
509
-
510
- ```sh
511
- ab-hosted-store tickets assign-team TEAM https://github.com/acme/app --user owner@example.com
512
- ab-postgres-store migrate
513
- ```
514
-
515
- The assignment journal works before v2 assertion, retains the actor, and grants
516
- no future cross-project access. Migration preserves ids, states, comments,
517
- blockers, timestamps and assets. Populated-v1 migration and deployment builds
518
- require the running service's blob backend, access mode, credentials and prefix
519
- (`AB_BLOB_PREFIX`), not just PostgreSQL access. `deploy:build` inherits this
520
- environment and migration failure stops Next build. Fresh databases, empty v1
521
- queues and v2 reruns stay SQL-only and do not initialize blob storage.
427
+ service ticket HTTP and operator surfaces refuse with project/source
428
+ feedback rather than returning an empty queue.
522
429
 
523
430
  ## Local builds with hosted tickets
524
431
 
@@ -591,14 +498,12 @@ Follow [ticket migration](ticket-migration.md), keeping the existing BuildStore
591
498
  and recording continuity before resuming build-related ticket writes.
592
499
 
593
500
 
594
- The retired `AB_WEB_ALLOWED_EMAILS` variable is refused at startup, even if empty.
595
- Replace it with `AB_WEB_SUPER_USER_EMAILS`; review the list because these identities
596
- are deployment maintainers. Open Organizations from the account menu to create
597
- the first organization, then Members to add people by email and choose an owner,
598
- and Projects to assign legacy unassigned projects. The
599
- [browser management contract](operator-api.md#organization-management-browser)
600
- also documents the underlying HTTP routes. Super users alone
601
- create orgs, set or clear the single owner, and assign or move projects. Owners
602
- manage their org's members. Removing the last membership or super-user designation
603
- revokes human access on the next request without re-login; existing project
604
- credentials remain valid until revoked.
501
+ Permanent hosted data removal is available on the web app's Projects page to
502
+ super users and owners of the project's organization. `ab disconnect` only
503
+ revokes a credential; admin `projects remove` only unregisters access and retains
504
+ data. Project deletion removes hosted builds, tickets, blobs, secrets and accounts,
505
+ revokes every credential and retains only a minimal deletion audit. It does not
506
+ change local files or configuration. Failed cleanup is retryable with access
507
+ already refused. Reconnecting requires fresh browser approval and starts empty,
508
+ with hosted ticket numbering reset to 1. See
509
+ [permanent project deletion](operator-api.md#permanent-project-deletion).
@@ -52,7 +52,9 @@ cluster and author; you never create or move tickets.
52
52
  {"action":"suppress","reason":"...","observations":[...]}
53
53
  ```
54
54
 
55
- Join only an existing unresolved ticket supplied by the ledger. Suppress a
55
+ Ledger lifecycle is scan-time context; filing checks existence and resolution
56
+ again before allowing a join, sharing that fresh lookup with hosted alias
57
+ resolution. Join only an existing unresolved ticket supplied by the ledger. Suppress a
56
58
  duplicate whose ledger ticket is resolved/missing, or a record that cannot
57
59
  support actionable work. Never invent a ticket reference.
58
60
  3. Finish exactly once:
@@ -29,7 +29,9 @@ not author proposals or touch tickets.
29
29
  - every `blockedBy` id is justified by evidence as a hard start gate;
30
30
  contextual citations, related work, and nonbinding preferences such as
31
31
  “do this later” must not become blockers, and ticket ids are never invented;
32
- - joins name only an unresolved ledger proposal and resolved/missing ledger
32
+ - ledger lifecycle is scan-time context; filing refreshes existence and
33
+ resolution before allowing joins and shares that lookup with hosted alias
34
+ resolution. Joins name only an unresolved ledger proposal and resolved/missing ledger
33
35
  tickets are tombstones, not recreated work;
34
36
  - suppression has a concrete evidence-backed reason;
35
37
  - no proposal asks harvest to groom, ready, claim, or dispatch anything.
@@ -273,15 +273,13 @@ and concurrency. The service does not load your prompt or operator notes, run
273
273
  a durable agent loop, deliver wake messages, or resume you on a timer.
274
274
  Read notes and current repository facts explicitly before acting. Tool writes
275
275
  use the authenticated binding's operator identity: local MCP uses the local
276
- operator identity, and hosted MCP uses the authenticated user's authority.
276
+ operator identity; Operator API clients use their authenticated authority.
277
277
  Do not assume session-owner delegation or a runner-provided repository scope.
278
278
 
279
279
  ### Human approvals
280
280
 
281
281
  Respect a human denial as a firm no. Any approval or suspension flow in your
282
- external harness belongs to that harness. Hosted session approval answers are
283
- durable records only; the service does not execute approved calls or resume
284
- agents. Do not repeat completed work when your harness resumes.
282
+ external harness belongs to that harness. Protocol session approval answers are durable records only. Do not repeat completed work when your harness resumes.
285
283
 
286
284
  ### The tool surface
287
285
 
@@ -305,7 +303,8 @@ that does the job, and say what you are doing before you do it:
305
303
  verification-failed nodes accept body/ticket spec revision without an escalation;
306
304
  the caller supplies the amended body for ticket origin. The node recollects and
307
305
  verifies; leaves require an escalation and restart from plan.
308
- - `tickets.list`, `tickets.get` — read the ticket queue and one ticket.
306
+ - `tickets.list`, `tickets.get` — read the ticket queue and one ticket. A long
307
+ queue pages with `limit`, `offset` and `order`; `total` counts every match.
309
308
  - `tickets.create` — file a new ticket from a conversation.
310
309
  - `tickets.update`, `tickets.block`, `tickets.unblock` — edit fields and
311
310
  blocker relations.
@@ -433,7 +432,7 @@ for the exceptions above.
433
432
  id you act on came from a tool result or the conversation.
434
433
  - External harnesses own concurrency and incoming-message handling; the
435
434
  service provides no one-turn-at-a-time or queued-message execution guarantee.
436
- - Where operator notes exist (hosted), they are shared ground truth; keep
435
+ - Where your harness provides shared operator notes, keep
437
436
  them current when you learn something durable.
438
437
 
439
438
  ## Drive the tree through one consent queue
@@ -119,7 +119,7 @@ say you will operate it. The human's explicit instructions override either defau
119
119
  If grooming established prerequisites, follow the complete
120
120
  [safe blocker-filing workflow](../ab-guide/references/ticket-dependencies.md).
121
121
  A single `ab ticket create --blocked-by` invocation does not publish atomically:
122
- Linear (including hosted Linear) exposes the issue before separate blocker writes.
122
+ Linear exposes the issue before separate blocker writes.
123
123
  For a ready destination, create in a known non-ready staging state, pass all
124
124
  blockers at creation, read back and verify them, then move to ready last. The
125
125
  human's requested final placement still wins; temporary staging needs no new
@@ -52,7 +52,8 @@ When `[tickets].source = "hosted"`, use readable ids such as `ENG-12` with
52
52
  `ab ticket show`, `update`, `move`, `block`, and `unblock`. Inputs accept any
53
53
  letter case and old UUID ids remain aliases. Output shows canonical readable
54
54
  ids; blocker references use the same identity. Numbering belongs to each project
55
- and never resets or reuses deleted numbers. A `teamKey` change affects future
55
+ and never resets or reuses deleted numbers within a project lifetime. Permanent
56
+ project deletion removes the counter; browser-approved reconnection starts at 1. A `teamKey` change affects future
56
57
  prefixes only. File and Linear id rules are unchanged. See the
57
58
  [hosted ticket protocol](../ab-guide/references/remote-ticket-protocol.md).
58
59
 
@@ -97,7 +98,7 @@ succeeds.
97
98
 
98
99
  For dependencies on any source, follow the
99
100
  [safe blocker-filing workflow](../ab-guide/references/ticket-dependencies.md).
100
- Direct and hosted Linear record blockers after creating the issue, so a ready
101
+ Direct Linear record blockers after creating the issue, so a ready
101
102
  issue can be claimed before `create --blocked-by` returns. Stage dependents in a
102
103
  known non-ready state, verify all blockers with `ab ticket show --json`, then use
103
104
  `ab ticket move` to publish the intended ready destination. Do not use the local
@@ -4,8 +4,8 @@
4
4
  "build": "ab-hosted-service-build"
5
5
  },
6
6
  "dependencies": {
7
- "@defrex/autobuild-hosted-store-service": "1.1.0",
8
- "@defrex/autobuild": "1.1.0",
7
+ "@defrex/autobuild-hosted-store-service": "1.2.0",
8
+ "@defrex/autobuild": "1.2.0",
9
9
  "next": "16.1.6",
10
10
  "react": "19.2.4",
11
11
  "react-dom": "19.2.4"
@@ -1,178 +0,0 @@
1
- # Hosted dispatcher cutover validation — AUT-320
2
-
3
- - **Validation run:** 2026-09-11, window 19:06:24Z – 19:41:52Z; verification re-derived from fresh Store snapshots at 22:41Z and again at 23:29Z after the implement phase re-ran in a fresh workspace (the durable log below is live and keeps accumulating)
4
- - **Build:** `validate-hosted-dispatcher` on `https://autobuild.defrex.com` (durable event log: `GET /builds/validate-hosted-dispatcher/events` or the web dashboard)
5
- - **Branch:** `ab/validate-hosted-dispatcher` (PR publication requested with auto-merge; publication and merge happen after the implement session — the build slug carries the final merged state)
6
- - **Tickets:** [AUT-320](https://linear.app/issue/AUT-320) (this validation), [AUT-304](https://linear.app/issue/AUT-304) (acceptance evidence attached to its body)
7
- - **Method note:** all numbers below were re-derived from fresh Store snapshots at implement time, at the guidance round (repository journal seq 1–926, build event log seq 1–45, as of 2026-09-11T22:41Z), and again at 23:29Z on the re-run implement session (journal seq 1–1117, build event log seq 1–60). Snapshots are labeled as-of; the durable event log is authoritative.
8
-
9
- ## Checklist verdicts
10
-
11
- | Checklist item | Verdict | Evidence |
12
- | --- | --- | --- |
13
- | Environment variables set | ✅ | Hosted ticks deposit `dispatcher-effective-config` artifacts (rev 50 as of 19:54:50Z) declaring workspace provider `vercel-sandbox`, env var `AI_GATEWAY_API_KEY`, AI-gateway model sessions (`vercel-ai-gateway/zai/glm-5.3-flash`, `vercel-ai-gateway/meta/muse-spark-1.3`), and runtime provisioning with preflight checks. Every hosted tick since 19:06 completes and deposits the artifact. |
14
- | Cron live | ✅ | 265 `dispatcher.run-started` events at ≈60 s median cadence from 19:06:24Z through 23:28:50Z (latest snapshot), all run ids `hosted-dispatcher-<uuid>`, all 265 ending `run-stopped outcome=normal`. |
15
- | Harvest gate off | ✅ | Last `harvest.completed` at 03:05:04Z (journal seq 59); no `harvest.*` event since. |
16
- | Local `ab-dispatch-kernel` stopped on every maintainer machine | ✅ (store-side layers + maintainer attestation with attached evidence) | Three-layer verification below. The store-side layers prove no interactive local dispatcher ever wrote to this repository and no dispatcher of any mode claimed build work in the window; the process-level residue on maintainer machines is covered by the maintainer's attestation with attached command output (see Process evidence). |
17
-
18
- ## Three-layer verification
19
-
20
- The journal alone cannot prove absence of local dispatchers: only the interactive
21
- frontend's child kernel carries a `kernelRunId`, so a headless local run
22
- (`ab dispatch --once --plain`) writes no `dispatcher.run-started`/tick events at
23
- all. The verification therefore stacks three bounded layers.
24
-
25
- ### Layer 1 — Repository journal (proves: hosted cadence live; no *interactive* local dispatcher)
26
-
27
- Journal seq 1–1117, complete from 2026-09-11T02:17:59Z (no gaps; the hosted
28
- repository store came up that morning). Re-derived 22:41Z and again 23:29Z.
29
- Findings:
30
-
31
- - 265 `dispatcher.run-started` events — **every one** with run id prefixed
32
- `hosted-dispatcher-`; zero bare-UUID (interactive local) run ids in the
33
- entire journal history.
34
- - Cadence ≈60 s median (min 11 s, max 63 s; first 19:06:24Z, last in snapshot
35
- 23:28:50Z); 265/265 `run-stopped` with `outcome=normal`.
36
- - The only two `dispatcher.tick-yielded` events (seq 144, 19:25:50Z; seq 1111,
37
- 23:27:52Z) are both hosted→hosted (run/holder ids all `hosted-dispatcher-*`).
38
- - No `harvest.*` event after 03:05:04Z (none after the window opened).
39
- - Zero journal events mention any maintainer hostname (`aron-desktop` does not
40
- appear anywhere in the journal).
41
-
42
- **Bound:** proves nothing about headless local dispatchers, which never write
43
- journal events.
44
-
45
- ### Layer 2 — Build-scoped execution facts (proves: no dispatcher of *any* mode claimed work in the window)
46
-
47
- A dispatcher that actually claims and works a build writes build-scoped facts
48
- regardless of interactive/headless mode: `workspace.provision-started` and,
49
- decisively, `execution.started` whose `instance` is
50
- `${hostname()}-${slug}-inst_<id>` — a plain store append, never gated on
51
- `kernelRunId`. The hosted deployment stamps the Vercel function's hostname
52
- (link-local `169.254.x.x` form); a maintainer machine's dispatcher would stamp
53
- its own hostname.
54
-
55
- - Build census (store `GET /builds`): the only build created after the window
56
- opened is `validate-hosted-dispatcher` (19:06:33Z); no older build was
57
- updated during the window (re-derived 22:41Z and again 23:29Z).
58
- - This build's `execution.started` events both stamp hosted instances:
59
- seq 21 (19:26:06Z, generation 0)
60
- `instance=169.254.67.163-validate-hosted-dispatcher-inst_e031dd81`,
61
- `provider=vercel-sandbox`, `sessionId=sbx_d4pBpd0TAJQyKxBW0setr3e8F7sE`;
62
- seq 56 (23:28:09Z, generation 1)
63
- `instance=169.254.30.93-validate-hosted-dispatcher-inst_d69843ce` —
64
- the hosted host component in both cases.
65
- - Zero `execution.started` events with a foreign hostname in the window;
66
- zero `workspace.provision-started` events anywhere in the store's builds
67
- outside this build during the window.
68
-
69
- **Bound:** an idle local dispatcher that claims nothing still leaves no trace;
70
- that residue is covered by Layer 3.
71
-
72
- **Recovery-fact caveat (recorded for honesty):** `infrastructure.failed`
73
- recovery facts carry the fixed instance name `dispatcher-recovery` and are
74
- attributed to the supervising (hosted) tick, so they are bounded by the hosted
75
- tick cadence rather than their own instance string. This build's three
76
- `infrastructure.failed` events are all provision failures of the incident
77
- below.
78
-
79
- ### Layer 3 — Maintainer-machine process evidence (supplied by the maintainer)
80
-
81
- An idle local `ab dispatch` process that claims nothing leaves no store trace,
82
- so this layer cannot be derived from the Store. The implementer escalated
83
- (`esc_e93b2831`, raised from this build) asking the maintainer to run, on every
84
- maintainer machine during the window, `pgrep -fl "ab-dispatch-kernel|ab
85
- dispatch"` plus scheduler listings (launchd/cron/systemd user timers) and
86
- attach the output to the escalation answer. The maintainer answered with a
87
- full attestation **and attached command output**, folded into the Process
88
- evidence section below.
89
-
90
- ## Process evidence (maintainer attestation, escalation esc_e93b2831)
91
-
92
- The maintainer collected the evidence at 2026-09-11T19:49Z on **aron-desktop**
93
- — the **only** maintainer machine (Linux; there is no macOS or Windows
94
- maintainer machine, so launchd/launchctl and PowerShell checks do not apply).
95
- Summary of the attached evidence:
96
-
97
- 1. **Processes.** `pgrep -fl "ab-dispatch-kernel|ab dispatch"` found exactly
98
- two processes (1096539 `bun …/bin/ab.ts dispatch`, 1096573
99
- `bun …/bin/ab-dispatch-kernel.ts`), both started 19:39:54Z, both with
100
- working directory `/home/defrex/code/parakeeto` — a **different
101
- repository's checkout** with its own Store repository identity. They cannot
102
- claim or supervise builds for `https://github.com/defrex/autobuild`. No `ab
103
- dispatch` process with cwd `/home/defrex/code/autobuild` exists.
104
- 2. **Last local dispatcher for this repository.** A headless `ab dispatch
105
- --plain --auto-merge` (kernel run id prefix `aron-desktop-*`) exited at
106
- 18:06:13Z — its log ends "dispatcher superseded by another invocation —
107
- detaching / ab dispatch stopped" — 60 minutes **before** the validation
108
- window opened at 19:06Z. It was never restarted.
109
- 3. **User schedulers.** `crontab -l` → crontab is not installed on the machine
110
- (no user cron entries possible); `systemctl --user list-timers --all` → "0
111
- timers listed". No launchd (not macOS).
112
- 4. **Corroborating durable evidence.** Every `dispatcher.run-started` /
113
- tick / `run-stopped` fact for this repository from 19:06:24Z onward carries
114
- a `hosted-dispatcher-<uuid>` run id (first:
115
- `hosted-dispatcher-c5fa724f-fa11-4250-8dbb-3274510a2022`); no
116
- `aron-desktop-*` holder appears in the journal after 18:06Z. This build's
117
- own `execution.started` (seq 21) names instance
118
- `169.254.67.163-validate-hosted-dispatcher-inst_e031dd81` — a hosted
119
- function address, not a maintainer host.
120
-
121
- **Maintainer conclusion (verbatim intent):** no local `ab dispatch` process for
122
- this repository was running during 19:06–19:42Z, and none is running now.
123
- Recorded as maintainer attestation with the attached outputs; the store-side
124
- Layers 1–2 independently prove no dispatcher of any mode claimed or executed
125
- build work in the window.
126
-
127
- ## Provision incident (honest record)
128
-
129
- The first three provision attempts failed with
130
- `Executable not found in $PATH: "bun"` (19:06–19:15Z) — the exact symptom
131
- `docs/hosted-dispatcher.md` documents for a deployment that skipped
132
- `pack-distribution`. After `maxInfrastructureAttempts` (3) was exhausted the
133
- kernel raised escalation `esc_84b0cddf` (19:15:51Z, policy guard
134
- `infrastructure-failure-limit`); the operator answered with a bare retry at
135
- 19:24:37Z, and provisioning succeeded at 19:25:51Z on the next hosted tick.
136
- The generation-1 re-provision (23:26:54Z → 23:27:53Z, after the publication
137
- note below) succeeded with no operator intervention.
138
- **Verdict: the cutover works, with one operator intervention.** A follow-up
139
- observation was recorded for the deployment's build/pack step.
140
-
141
- ## Publication note (honest record)
142
-
143
- The implement phase requested publication at 22:43:01Z (event seq 49,
144
- `publication.requested`; auto-merge had been requested at build creation,
145
- seq 2). That first publication did not complete before the implement
146
- workspace's environment lifetime ended: `execution.ended` at 23:26:51Z
147
- (seq 51), the workspace was released, and a fresh generation-1 workspace was
148
- provisioned for the re-run implement session. The prior workspace's un-pushed
149
- commits were lost with it; store-side deposits (build artifacts, observations,
150
- the escalation answer, the AUT-304 evidence section) persisted. This session
151
- re-committed the repository deliverable (this document) and re-requests
152
- publication. Publication, verify, review, and merge happen after this
153
- session; the build slug `validate-hosted-dispatcher` carries the final state.
154
- A follow-up observation was recorded for the publication path.
155
-
156
- ## Cutover outcome (as of implement time)
157
-
158
- - Ticket moved to Todo → claimed and built by the hosted deployment alone:
159
- **confirmed** (Layers 1–2; single active build, hosted execution instances).
160
- - Published as a PR, and merged: PR publication is **requested** (auto-merge
161
- requested at build creation; publication re-requested by this session) from
162
- branch `ab/validate-hosted-dispatcher` into `main`; verify, review,
163
- publication, and merge happen after this session, and the build slug
164
- `validate-hosted-dispatcher` on the dashboard carries the final state. This
165
- document deliberately does not claim "published" or "merged".
166
-
167
- ## Evidence index
168
-
169
- - Build event log (durable, live): `https://autobuild.defrex.com` → build
170
- `validate-hosted-dispatcher` (API: `GET /builds/validate-hosted-dispatcher/events`)
171
- - Repository journal (durable, live): `GET /repos/https%3A%2F%2Fgithub.com%2Fdefrex%2Fautobuild/events`
172
- - Deposited build artifacts: `cutover-build-event-log`, `cutover-repository-journal`,
173
- `cutover-validation-report` (attached to the PR description at finalize)
174
- - Dispatcher effective config: repository artifact kind
175
- `dispatcher-effective-config`, rev 50 as of 2026-09-11T19:54:50Z
176
- - Branch: `ab/validate-hosted-dispatcher` → PR into `main` (auto-merge requested)
177
- - Tickets: [AUT-320](https://linear.app/issue/AUT-320),
178
- [AUT-304](https://linear.app/issue/AUT-304) (evidence section appended to body)