@defrex/autobuild 1.5.0 → 1.7.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 (126) hide show
  1. package/README.md +1 -1
  2. package/SPEC.md +192 -24
  3. package/docs/agent-runtimes.md +1 -1
  4. package/docs/answering-blocked-builds.md +7 -4
  5. package/docs/architecture.md +100 -32
  6. package/docs/configuration-overview.md +10 -0
  7. package/docs/configuration.md +340 -10
  8. package/docs/dispatcher.md +2 -2
  9. package/docs/forges.md +1 -0
  10. package/docs/glossary.md +1 -1
  11. package/docs/operating.md +1 -1
  12. package/docs/operator-api.md +33 -10
  13. package/docs/operator-surfaces.md +6 -3
  14. package/docs/plugin-authoring.md +48 -6
  15. package/docs/remote-store-protocol.md +33 -10
  16. package/docs/restacking.md +16 -7
  17. package/docs/ticket-sources.md +34 -6
  18. package/docs/tickets.md +7 -1
  19. package/docs/troubleshooting.md +1 -1
  20. package/docs/workspaces.md +1 -1
  21. package/package.json +3 -3
  22. package/packages/core/src/cli/attention.ts +3 -0
  23. package/packages/core/src/cli/binary-direct.ts +1 -0
  24. package/packages/core/src/cli/dashboard/model.ts +14 -4
  25. package/packages/core/src/cli/dashboard/poll.ts +14 -0
  26. package/packages/core/src/cli/dashboard/render.ts +3 -0
  27. package/packages/core/src/cli/dispatch-frontend.ts +10 -14
  28. package/packages/core/src/cli/dispatch-preflight.ts +5 -1
  29. package/packages/core/src/cli/dispatch-repository-feed.ts +145 -109
  30. package/packages/core/src/cli/dispatch-tickets.ts +47 -0
  31. package/packages/core/src/cli/dispatch-upgrade-controller.ts +3 -0
  32. package/packages/core/src/cli/dispatch.ts +377 -101
  33. package/packages/core/src/cli/help.ts +15 -6
  34. package/packages/core/src/cli/init-validation.ts +14 -1
  35. package/packages/core/src/cli/repo-lease.ts +225 -0
  36. package/packages/core/src/cli/repository-status.ts +40 -3
  37. package/packages/core/src/cli/status.ts +21 -13
  38. package/packages/core/src/cli/ticket.ts +22 -4
  39. package/packages/core/src/cli/wait.ts +4 -1
  40. package/packages/core/src/cli/watch.ts +17 -4
  41. package/packages/core/src/config/live.ts +4 -0
  42. package/packages/core/src/config/profiles.ts +96 -0
  43. package/packages/core/src/config/ready-assignee.ts +43 -11
  44. package/packages/core/src/config/roles.ts +33 -10
  45. package/packages/core/src/config/schema.ts +204 -26
  46. package/packages/core/src/events/catalog.ts +2 -0
  47. package/packages/core/src/events/compatibility.ts +3 -1
  48. package/packages/core/src/events/forge-degradation-policy.ts +16 -2
  49. package/packages/core/src/events/payloads.ts +23 -0
  50. package/packages/core/src/events/policy.ts +3 -0
  51. package/packages/core/src/events/repository.ts +19 -0
  52. package/packages/core/src/kernel/__snapshots__/reducer-accumulator-shapes.json +267 -352
  53. package/packages/core/src/kernel/build-creation.ts +29 -0
  54. package/packages/core/src/kernel/dispatch-capacity.ts +134 -30
  55. package/packages/core/src/kernel/engine.ts +13 -6
  56. package/packages/core/src/kernel/forge-health.ts +47 -0
  57. package/packages/core/src/kernel/generators/build-log.ts +9 -0
  58. package/packages/core/src/kernel/guarded-forge.ts +76 -18
  59. package/packages/core/src/kernel/incremental-fixtures.ts +1 -0
  60. package/packages/core/src/kernel/janitor-failure.ts +85 -5
  61. package/packages/core/src/kernel/leaf-restack-state.ts +4 -2
  62. package/packages/core/src/kernel/log-index.ts +1 -1
  63. package/packages/core/src/kernel/node-landing.ts +2 -1
  64. package/packages/core/src/kernel/node-parent.ts +2 -0
  65. package/packages/core/src/kernel/read-facts.ts +9 -1
  66. package/packages/core/src/kernel/reducer-registry.ts +6 -1
  67. package/packages/core/src/kernel/reducer.ts +75 -4
  68. package/packages/core/src/kernel/ticket-preparation.ts +15 -8
  69. package/packages/core/src/operator/protocol.ts +10 -0
  70. package/packages/core/src/operator/query.ts +16 -13
  71. package/packages/core/src/operator/registry.ts +25 -5
  72. package/packages/core/src/operator/sandbox-host.ts +3 -0
  73. package/packages/core/src/operator/tickets.ts +15 -3
  74. package/packages/core/src/plugin-sdk/index.ts +4 -0
  75. package/packages/core/src/ports/forge/create.ts +6 -0
  76. package/packages/core/src/ports/forge/github-transport.ts +40 -3
  77. package/packages/core/src/ports/forge/github.ts +12 -1
  78. package/packages/core/src/ports/forge/workspace-ancestry.ts +60 -0
  79. package/packages/core/src/ports/forge-failure.ts +31 -2
  80. package/packages/core/src/ports/runner/routing.ts +66 -5
  81. package/packages/core/src/ports/tickets/assignees.ts +54 -0
  82. package/packages/core/src/ports/tickets/contract.ts +164 -4
  83. package/packages/core/src/ports/tickets/create.ts +35 -7
  84. package/packages/core/src/ports/tickets/github-fake.ts +18 -2
  85. package/packages/core/src/ports/tickets/github.ts +247 -29
  86. package/packages/core/src/ports/tickets/hosted-index.ts +1 -0
  87. package/packages/core/src/ports/tickets/operations.ts +6 -1
  88. package/packages/core/src/ports/tickets/tree.ts +12 -2
  89. package/packages/core/src/ports/tickets/update.ts +6 -2
  90. package/packages/core/src/ports/types.ts +37 -3
  91. package/packages/core/src/ports/workspace/commit-preservation.ts +28 -12
  92. package/packages/core/src/ports/workspace/git-worktree.ts +3 -1
  93. package/packages/core/src/ports/workspace/harvest-execution.ts +4 -2
  94. package/packages/core/src/ports/workspace/vercel-sandbox.ts +12 -0
  95. package/packages/core/src/processes/build-child.ts +28 -7
  96. package/packages/core/src/processes/build-execution-state.ts +4 -1
  97. package/packages/core/src/processes/build-runner.ts +17 -2
  98. package/packages/core/src/processes/dispatcher.ts +329 -59
  99. package/packages/core/src/processes/execution-no-progress.ts +2 -0
  100. package/packages/core/src/processes/harvest-child.ts +8 -2
  101. package/packages/core/src/processes/harvest-execution-state.ts +104 -0
  102. package/packages/core/src/processes/harvest-runner.ts +251 -17
  103. package/packages/core/src/processes/repo-view.ts +2 -0
  104. package/packages/core/src/scenarios/harness.ts +160 -36
  105. package/packages/core/src/store/reduced-reads.ts +10 -0
  106. package/packages/core/src/store/reducer-value-shapes.json +3339 -2898
  107. package/packages/core/src/store/remote/client.ts +21 -8
  108. package/packages/core/src/store/remote/index.ts +4 -0
  109. package/packages/core/src/store/remote/protocol.ts +7 -0
  110. package/packages/core/src/store/remote/released-clients.json +22 -0
  111. package/packages/core/src/store/remote/released-reducer-values/1.6.0.json +27173 -0
  112. package/packages/core/src/store/remote/released-reducer-values/1.7.0.json +27366 -0
  113. package/packages/core/src/store/remote/released-reducer-values/index.ts +4 -0
  114. package/packages/core/src/store/repo-state-events.ts +1 -0
  115. package/packages/core/src/store/types.ts +11 -0
  116. package/packages/core/src/testing/dispatch-read-budget.ts +84 -58
  117. package/packages/core/src/testing/index.ts +2 -0
  118. package/packages/core/src/testing/reduced-read-budget.ts +411 -11
  119. package/skills/guide/SKILL.md +166 -35
  120. package/skills/guide/references/operator-api.md +33 -10
  121. package/skills/guide/references/plugin-authoring.md +48 -6
  122. package/skills/guide/references/remote-store-protocol.md +33 -10
  123. package/skills/guide/references/restacking.md +16 -7
  124. package/skills/operate/SKILL.md +79 -14
  125. package/skills/tickets/SKILL.md +22 -4
  126. package/templates/hosted-service/package.json +2 -2
@@ -83,15 +83,22 @@ spec → plan ⇄ plan-review → implement ⇄ code-review → verify:* → fin
83
83
  gate — urgent tickets first, then normal ones, each in the source's order —
84
84
  chooses a short immutable slug from the final conforming spec, and
85
85
  starts builds up to the top-level `capacity` bound, after slots reserved for
86
- integration nodes awaiting verification or reconcile. Priority never preempts
87
- a running build.
86
+ integration nodes awaiting verification or reconcile and for finished builds
87
+ waiting to re-verify or reconcile. `capacity` counts builds running work: a
88
+ build that finished its pipeline holds no slot while it waits for a merge
89
+ decision, though it keeps its workspace until it merges or closes. Priority
90
+ never preempts a running build.
88
91
  - **Failed preparation.** Durable preparation facts protect the claim-to-build
89
92
  interval. Caught failures return tickets to Ready (invalid specs to Triage),
90
- after exact build-ownership readback. Unresolved attempts stay withheld and
91
- retry before intake, even at full capacity or with intake disabled. Unsafe
92
- ownership or externally changed/missing tickets end automatic recovery with
93
- a diagnostic `abandoned` resolution, reported once in that tick's dispatcher
94
- diagnostics, leaving the ticket unchanged. See
93
+ after build-ownership readback at the selected slug and, for a keyed attempt,
94
+ the canonical slug its creation key derives. Unresolved attempts stay withheld
95
+ and retry before intake, even at full capacity or with intake disabled. Unsafe
96
+ ownership, an unprovable creation outcome, or externally changed/missing
97
+ tickets end automatic recovery with a diagnostic `abandoned` resolution,
98
+ reported once in that tick's dispatcher diagnostics and once as default
99
+ `ab watch` repository attention, leaving the ticket unchanged. The resolution
100
+ records whether the claim was confirmed; an unconfirmed claim's provider
101
+ outcome is unknown. See
95
102
  [Ticket preparation recovery](references/restacking.md#ticket-preparation-before-build-creation).
96
103
  - **Ticket assets** — files or folders attached to a ticket (see
97
104
  [Ticket assets](#ticket-assets)) are frozen into the build at claim and
@@ -436,7 +443,8 @@ evaluated as config logic.
436
443
 
437
444
  **Strictness:** unknown top-level keys/tables and unknown keys inside known
438
445
  tables are **errors**, not warnings — a typo must not silently disable a
439
- verifier. The open maps are `[accounts]`, `[commands]`, `[roles]`, `[workspace.config]`,
446
+ verifier. The open maps are `[accounts]`, `[commands]`, `[roles]`, `[profiles]`,
447
+ `[profiles.<name>.roles]`, `[workspace.config]`,
440
448
  `[workspace.config.runtimeProvisioning]`, `[verify.<step>]`, and
441
449
  `[finalize.<step>]`. Autobuild strictly validates the
442
450
  repository-defined command, role, and step entries. `[workspace.config]` is
@@ -488,7 +496,7 @@ under the preceding table.
488
496
  |---|---|---|---|
489
497
  | `baseBranch` | `"main"` | nonempty string | The branch builds branch from and target with their PR; what `reconcile` replays the build change onto. |
490
498
  | `ticketScanIntervalSeconds` | `60` | positive integer seconds | Hot-reloaded ready scan cadence; tick spacing is the floor, and same-repository merge/completion/abort forces an early scan. |
491
- | `capacity` | `1` | positive integer | Maximum concurrent builds for this repository. |
499
+ | `capacity` | `1` | positive integer | Maximum builds running work at once for this repository; builds parked for a merge decision hold no slot. |
492
500
  | `forge` | `"github"` | nonblank string | Selects shipped `github` or `local-git`, or a plugin-registered Forge adapter. `github` authenticates with `GITHUB_TOKEN`, then `GH_TOKEN`, then the gh CLI's stored login. |
493
501
  | `plugins` | `[]` | array of unique nonblank module specifiers | Trusted Bun plugin modules loaded before dispatch, `ab ticket`, and scoped phase wiring. |
494
502
 
@@ -834,6 +842,8 @@ The step's configured skill name remains a deprecated alias for existing
834
842
  configurations and will be removed in a future release. It applies only when
835
843
  `[roles.<step>]` is undeclared, so the step name always wins when both are
836
844
  present, and `ab dispatch` reports the alias with the step name to rename it to.
845
+ A [role profile](#profiles) the build selected can override the step's role
846
+ for that build.
837
847
  Written order never reorders execution: the event records the canonical config
838
848
  order. No front matter means all configured steps, preserving old plans and
839
849
  logs; an explicit empty list is valid only when all steps are optional. The
@@ -933,7 +943,9 @@ non-destructive execution fence for the exact workspace and execution generation
933
943
  It preserves unpublished branch commits and distinct detached producer candidates
934
944
  under immutable `refs/autobuild/archive/<build>/<sha>` refs, verifies their exact
935
945
  readback, and records `workspace.commits-preserved` before cleanup. Replacement
936
- provisioning restores those exact refs before starting an agent. A preserved
946
+ provisioning restores those exact refs before starting an agent, reading them
947
+ from the local repository with the local-git forge and fetching each exact ref
948
+ from the remote otherwise. A preserved
937
949
  branch head that the build's latest 64 replaced heads cover, as the replaced
938
950
  head itself or one of its ancestors, is kept only as archived objects: it is
939
951
  never preserved or restored as the branch, and provisioning records the skip as
@@ -1081,6 +1093,8 @@ examples, remedies and regional routing are in [billing accounts](references/acc
1081
1093
  ### `[roles]`
1082
1094
 
1083
1095
  An **open map** of role name → `{ runtime?, model?, account?, args?, extensions?, sessionBudgetSeconds?, alternates? }`.
1096
+ These are the repository's roles for every build; a ticket label can select a
1097
+ [`[profiles]`](#profiles) entry that overrides some of them for that build.
1084
1098
  The four primary axes, session budget, and ordered alternate list inherit independently. The reserved `default` role must explicitly name a
1085
1099
  runtime, is the raw inheritance base for every other role, and is **never
1086
1100
  dispatched as a phase**. Its absence fails eager resolution before a session,
@@ -1202,6 +1216,50 @@ or `phase.failed`. A typed terminal racing either boundary remains authoritative
1202
1216
  Agent finalize post-step expiry is failure-tolerant; Harvest and direct check
1203
1217
  commands are outside this budget.
1204
1218
 
1219
+ ### `[profiles]`
1220
+
1221
+ An **open map** of profile name → `{ label, roles }`, for tickets that justify
1222
+ different role settings without changing the roles every other build reads.
1223
+
1224
+ ```toml
1225
+ [profiles.deep]
1226
+ label = "deep"
1227
+
1228
+ [profiles.deep.roles.plan-review]
1229
+ model = "claude-opus-5-5"
1230
+
1231
+ [profiles.deep.roles.implement]
1232
+ args = ["--effort", "high"]
1233
+ ```
1234
+
1235
+ - **Overlay.** A `[profiles.<name>.roles.<role>]` entry accepts the
1236
+ `[roles.<role>]` fields and may name any role, including agent verify and
1237
+ finalize step names and roles `[roles]` does not declare. Each declared
1238
+ field overrides; each omitted field comes from `[roles.<role>]`, then
1239
+ `[roles.default]`. A declared `alternates` list, including `[]`, replaces the
1240
+ inherited list. Key selection walks the step name, then its deprecated
1241
+ skill-name alias, against profile entries and `[roles]` together. An entry
1242
+ named `default` is refused.
1243
+ - **Selection is fixed at claim.** `label` matches ticket labels
1244
+ case-insensitively after trimming. The dispatcher records the selected
1245
+ profile on `build.created`; relabelling later has no effect. A node and each
1246
+ child select from their own ticket. A ready ticket carrying two profiles'
1247
+ labels is not claimed and appears as a `queue:` line in
1248
+ `ab repository status` until it carries at most one. A ticket can only
1249
+ select a profile; it never supplies a model, runtime or argument itself.
1250
+ - **Contents are live.** Every agent session of the build (plan, plan
1251
+ review, implement, code review, agent verify and finalize steps, reconcile)
1252
+ resolves through the profile read from the current configuration, so an
1253
+ edit reaches only the builds that selected it, at their next session.
1254
+ `session.started.profile` records `{ name, configured }`. If a reload removes
1255
+ the profile, those builds continue on the repository roles and
1256
+ `ab build status` says the profile is no longer configured.
1257
+ - **Validation.** Duplicate labels, a missing or blank label, and an entry
1258
+ whose effective runtime, model, args or account would be refused for a
1259
+ `[roles]` entry fail config load, `ab init --validate` and a live reload.
1260
+ - **Scope.** Sessions outside a build (`slug`, `upgrade`, `harvest`,
1261
+ `harvest-review`) never use a profile.
1262
+
1205
1263
  Mixing models across roles is **intentional**, not an inconsistency to clean
1206
1264
  up: a reviewer that differs from the implementer catches more. The removed
1207
1265
  legacy `[agent]` table is not an alias: config loading rejects it and directs
@@ -1215,6 +1273,8 @@ nonnegative integer so zero can disable that trigger.
1215
1273
  | Field | Default | Allowed / constraints | Effect |
1216
1274
  |---|---|---|---|
1217
1275
  | `upgradeDrainSeconds` | `900` | positive integer | Local generation drain deadline from handoff start; hot-reloaded while draining. |
1276
+ | `dispatchLeaseTimeoutSeconds` | `60` | positive integer, greater than `dispatchLeaseRenewalSeconds` | How long the repository dispatch lease survives without renewal. A dispatcher that stalls longer reclaims it on waking unless another dispatcher took it, in which case it stops as `superseded`; a standby takes over a dead holder within this bound. Adopted at the dispatcher's next tick. |
1277
+ | `dispatchLeaseRenewalSeconds` | `20` | positive integer, less than `dispatchLeaseTimeoutSeconds` | Interval between repository dispatch lease renewals; adopted together with the timeout. Configuration with renewal at or above the timeout is refused when it loads. |
1218
1278
  | `sessionBudgetSeconds` | `3600` | positive integer | Active-time bound for each build agent session unless its logical role overrides it; native continuation retains accumulated time and excludes suspension. |
1219
1279
  | `stallRounds` | `3` | positive integer | The same finding surviving this many review rounds auto-escalates for external judgment — the anti-loop guard. |
1220
1280
  | `maxVerifyAttempts` | `3` | positive integer | Caps distinct failed verify cycles since the latest spec revision; passed and skipped cycles cost zero. |
@@ -1225,6 +1285,7 @@ nonnegative integer so zero can disable that trigger.
1225
1285
  | `maxReviewRounds` | `6` | positive integer | Default `maxRounds` for the `plan ⇄ plan-review` and `implement ⇄ code-review` convergence loops. When that cap parks a build, `ab answer <slug> --review-round-ceiling <n>` may replace it for only the escalation's loop and current spec revision. |
1226
1286
  | `harvestThreshold` | `5` | positive integer | Newly unclaimed `observation.recorded` occurrences required to start one repository harvest run. |
1227
1287
  | `janitorFailureAttentionSeconds` | `600` | positive integer | Consecutive janitor failure duration before build attention. |
1288
+ | `janitorFailureEscalationSeconds` | `3600` | positive integer | Consecutive janitor failure duration before the build raises one escalation; the janitor keeps retrying. |
1228
1289
  | `nodeIdleAfterSeconds` | `600` | positive integer | Quiet period before opened integration nodes enter idle polling. |
1229
1290
  | `nodeIdlePollSeconds` | `120` | positive integer | Interval between idle node checks; durable activity wakes the next tick. |
1230
1291
  | `janitorBackoffMaxSeconds` | `300` | positive integer | Cap on exponential janitor retry delay, starting at 30 seconds. |
@@ -1306,7 +1367,8 @@ state eligible.
1306
1367
  | `readyLabels` | — (source-aware) | optional; array of nonempty strings | A ticket must carry **every** listed label to be dispatchable. `[]` = **no label gate**. Absent uses the source default below. |
1307
1368
  | `url` | selected build service | HTTPS URL (loopback HTTP allowed), no userinfo/query/fragment; hosted only | Ticket service independent of builds; required for local builds. |
1308
1369
  | `readyState` | hosted, github: `ready` | non-blank string; required for other sources | The one workflow state a ticket must sit in to be dispatchable. Linear matches exactly and case-sensitively; file matches it case-insensitively to a state directory (`ready` → `ready/`); github matches the `autobuild:<state>` label ignoring case. There is no any-state mode. |
1309
- | `readyAssignee` | — | optional; sources that declare the capability: `linear` (`"me"` or an email), `github` (`"me"` or a username, managed-user `name_shortcode` logins included), declaring plugins; refused for `file`/`hosted` | Also require the ticket to be assigned to that user; unassigned tickets are never ready. `me` is the credential owner: of `LINEAR_API_KEY` for `linear`, of the GitHub token for `github`. A `github` issue with several assignees matches any one of them. |
1370
+ | `readyAssignee` | — | optional; sources that declare the capability: `linear` (`"me"` or an email), `github` (`"me"` or a username, managed-user `name_shortcode` logins included), declaring plugins; refused for `file`/`hosted` | Also require the ticket to be assigned to that user; unassigned tickets are never ready. With `github`, each ready scan reports ready issues that have no assignee in the ticket diagnostics; assign one to make it claimable. `me` is the credential owner: of `LINEAR_API_KEY` for `linear`, of the GitHub token for `github`. A `github` issue with several assignees matches any one of them. |
1371
+ | `createAssignee` | — | optional; sources that declare the `assignees` capability: `github` (`"me"` or a username), declaring plugins; refused for `file`/`hosted`/`linear` | Assign every ticket Autobuild creates (`ab ticket create`, operator `tickets.create`, harvest proposals) to that user unless the create names its own assignees. `me` is the creating credential's owner, so a harvest proposal belongs to the filing dispatcher's owner. Pairs with `readyAssignee = "me"`. |
1310
1372
  | `teamKey` | — | required by `linear` and `hosted`, forbidden by `file` and `github`, allowed for plugins | The Linear team key (e.g. `"ENG"`), the captured prefix for new hosted ticket ids (`ENG-1`), or a plugin configuration field. Hosted numbers are project-local and continue across prefix changes; legacy ids remain aliases and readable inputs are case-insensitive. |
1311
1373
  | `claimedState` | hosted, github: `doing` | optional nonempty string; forbidden by `file`, allowed for plugins | Workflow state `claim()` moves a ticket to when a build starts. |
1312
1374
  | `doneState` | hosted, github: `"done"` | optional nonblank string | Project completion state and merged-ticket transition; hosted and github tickets only. A github ticket is done when its issue is closed as completed. |
@@ -1344,6 +1406,10 @@ Cross-field rules, each an **error**:
1344
1406
  `hosted`, or a plugin source without it). The error names the source; for a
1345
1407
  plugin it comes at startup and `ab init --validate`, after plugins load, and
1346
1408
  a live reload that adds it is rejected.
1409
+ - `createAssignee` on a source that can't store assignees (`file`, `hosted`,
1410
+ `linear`, or a plugin source without the `assignees` capability), the same
1411
+ way. `ab init --validate` also reports a `"me"` whose credential has no user
1412
+ and a user who can't be assigned issues in the repository.
1347
1413
  - `source = "file"` with `teamKey` or `claimedState` set. `dir` is **optional**
1348
1414
  here — absent means the default above, which is why the schema leaves it
1349
1415
  optional rather than giving it a `.default()`: that is what keeps the
@@ -1727,8 +1793,9 @@ every agent session as `AB_STORE`.
1727
1793
  One repository driven by several dispatchers — for example each engineer
1728
1794
  running `ab dispatch` locally — should share one store: connect every
1729
1795
  dispatcher to the same service with `ab connect`. Assignee gating
1730
- (`[tickets].readyAssignee`) divides tickets between dispatchers but not
1731
- store-owned state. Separate local stores each see only their own builds:
1796
+ (`[tickets].readyAssignee`, with `createAssignee = "me"` so each person's
1797
+ tickets and harvest proposals are assigned to them) divides tickets between
1798
+ dispatchers but not store-owned state. Separate local stores each see only their own builds:
1732
1799
 
1733
1800
  - **Nodes are owned by one store.** A child ticket can target only a node built
1734
1801
  in its own store; elsewhere it stays queued with `target node … is being
@@ -1826,12 +1893,12 @@ repository's `[tickets]` table selects. These forms therefore work unchanged
1826
1893
  with the file tracker, Linear, hosted tickets and GitHub issues, without
1827
1894
  provider-specific API/MCP calls:
1828
1895
 
1829
- - `ab ticket create <title> --body <file> [--state <state>] [--labels a,b] [--blocked-by id,id] [--issues N[:refs],...] [--priority urgent|normal] [--json]`
1896
+ - `ab ticket create <title> --body <file> [--state <state>] [--labels a,b] [--blocked-by id,id] [--issues N[:refs],...] [--priority urgent|normal] [--assignees a,b] [--json]`
1830
1897
  files a ticket. Without `--state`, the source uses `[tickets].createState` or
1831
1898
  its own default. A named state is passed through unchanged and the selected
1832
1899
  source validates it before creating anything. Blocker ids belong to the same
1833
1900
  source and are also checked before the single create call.
1834
- - `ab ticket update <id> [--title <title>] [--body <file>] [--labels a,b] [--issues N[:refs],...] [--priority urgent|normal] [--json]`
1901
+ - `ab ticket update <id> [--title <title>] [--body <file>] [--labels a,b] [--issues N[:refs],...] [--priority urgent|normal] [--assignees a,b] [--json]`
1835
1902
  partially replaces editable fields. At least one editable flag is required;
1836
1903
  `--json` alone is not an update.
1837
1904
  - `ab ticket block <id> <blocker-id[,blocker-id...]> [--json]` adds one or more
@@ -1904,6 +1971,15 @@ alone); plugin sources without the capability read every ticket as normal,
1904
1971
  refuse `urgent` naming themselves and writing nothing, and accept `normal`
1905
1972
  as a no-op. JSON
1906
1973
  ticket output always includes `priority`, and list output marks urgent tickets.
1974
+ `--assignees a,b` names usernames, or `me` for the owner of the source's
1975
+ credential, on a source that stores assignees (GitHub). On create it replaces
1976
+ the `[tickets].createAssignee` default and `--assignees ''` files the ticket
1977
+ unassigned; on update it replaces the whole set, `''` clears it, and omitting
1978
+ it leaves them alone. A user who can't be assigned, or a write the provider
1979
+ accepts without the assignees, fails naming the cause. `ab ticket show` prints
1980
+ assignees and JSON reads carry an `assignees` array; sources that can't store
1981
+ them (file, hosted, Linear) carry no field and refuse the option, naming
1982
+ themselves and writing nothing.
1907
1983
  Supplied title/body values must be
1908
1984
  nonblank. State is intentionally not an update field — `transition()` remains its sole owner —
1909
1985
  and every validation or unknown-ticket error occurs before
@@ -2101,6 +2177,8 @@ restack state and conflicting files remain in detail, along with every child's
2101
2177
  ticket id, title and live phase (or queued/merged), open-first counts, verification
2102
2178
  steps and current outcomes, repair instructions, and the merge rule. Cancelled
2103
2179
  children are omitted; historical missing titles or filenames are explicit.
2180
+ A work build that finished its pipeline and must re-verify or reconcile shows
2181
+ the same slot-wait alert on its row, and `ab builds` appends it to the phase.
2104
2182
 
2105
2183
 
2106
2184
  On a TTY, execution-mode `ab dispatch` renders one fixed interactive frame that fills the
@@ -2127,12 +2205,13 @@ the configured source's bounded state count itself, at most once per 60 s
2127
2205
  while it runs. It keeps its last good value through failed reads and through
2128
2206
  headless ticks that publish no count, and shows `–` until its first read
2129
2207
  succeeds or when the source has no state counts (Linear). `queue` is the
2130
- ready-ticket queue depth, and `active` is the current nonterminal-build count
2131
- against root `capacity`. Observation pressure is not a header counter: the
2208
+ ready-ticket queue depth, and `active` is occupied capacity (every unfinished
2209
+ build, plus finished builds running work again) against root `capacity`. Observation pressure is not a header counter: the
2132
2210
  Harvest row shows a run's observations, and `ab harvest status` reports
2133
2211
  Harvest state.
2134
- The execution-mode frontend checkpoints dashboard facts, the latest run start and the sampled
2135
- lease holder's start; identity history stays partial and missing holders use a
2212
+ The execution-mode frontend checkpoints only the latest run start and the sampled
2213
+ lease holder's start; dashboard facts render from the canonical reduced
2214
+ repository value. Identity history stays partial and missing holders use a
2136
2215
  bounded per-run lookup. Without a usable checkpoint, startup and recovery seed
2137
2216
  from the canonical reduced repository value, never the journal. Unchanged written/refused checkpoints are not uploaded
2138
2217
  again. Dirty saves run at most once per 30 seconds; transient failures retry
@@ -2462,8 +2541,9 @@ Every command requires an applicable target in this repository. Pause and
2462
2541
  resume require an active build; abort and hold also accept queued builds.
2463
2542
  Merge requires a ready candidate and cannot bypass verification or merge gates;
2464
2543
  a merge that is not ready is refused with code `merge-not-ready` (or
2465
- `node-incomplete` for an incomplete node) and a reason, and records nothing;
2466
- `ab answer` requires an open escalation except for eligible node spec revisions. A stale, missing, done,
2544
+ `node-incomplete` for an incomplete node) and a reason. A refusal records no
2545
+ merge consent and no landing; a node's live completeness check may still save
2546
+ an `integration.observed` diagnostic before it refuses. `ab answer` requires an open escalation except for eligible node spec revisions. A stale, missing, done,
2467
2547
  aborted, or otherwise inapplicable target is an error and gets no new event. Attribution uses `USER`, then `USERNAME`, then the
2468
2548
  same stable fallback on both surfaces. These commands run sessionless and
2469
2549
  accept `--store <ref>` with the usual explicit flag > `AB_STORE` > `[store] url` > repository
@@ -2477,10 +2557,12 @@ is inside the walk.
2477
2557
  These commands request normal kernel work; they do not wake a runner, operate
2478
2558
  the forge, or bypass the lease sweep. Resume is therefore an attempt, not a
2479
2559
  guarantee: if the condition still fails, a phase may raise a new escalation and
2480
- block again. Every open escalation, including all policy and setup causes,
2560
+ block again. Every open phase and policy escalation, including all setup causes,
2481
2561
  survives `ab dispatch` and `ab dispatch --once` startup until your operator agent or you
2482
- answer it. Startup still recovers actionable builds and delivers pending operator
2483
- commands, but it never records an answer or re-arms a budget.
2562
+ answer it. A janitor escalation is the exception: ordinary janitor retries continue
2563
+ across startup, a successful attempt closes it unanswered, and a bare retry only
2564
+ brings the next attempt forward. Startup still recovers actionable builds and
2565
+ delivers pending operator commands, but it never records an answer or re-arms a budget.
2484
2566
 
2485
2567
  Durable repository intake has launch-flag setters and a global-row toggle.
2486
2568
  Merge policy is configured through ordered rules, with per-merge hold/merge
@@ -2520,8 +2602,10 @@ repository-local precedence. The command uses the same reducer as the
2520
2602
  dispatcher and dashboard, writes no state, claims no ticket, attaches no runner,
2521
2603
  and starts no dispatcher work. Dispatcher identity includes the held run’s recorded
2522
2604
  runtime; historical starts without metadata display `runtime unrecorded`.
2523
- It also lists the latest ticket scan's dependency diagnostics (`queue:` lines,
2524
- `dependencyDiagnostics` in JSON), including tickets held because their target
2605
+ It also lists the latest ticket scan's ticket and dependency diagnostics
2606
+ (`queue:` lines, `ticketDiagnostics` and `dependencyDiagnostics` in JSON),
2607
+ including ready tickets whose labels select more than one role profile and
2608
+ tickets held because their target
2525
2609
  node is being built by another store, and dispatcher startup warnings
2526
2610
  (`warningLines`).
2527
2611
 
@@ -2550,7 +2634,9 @@ cycle, PR lifecycle, latest event, durable progress age, heartbeat, and lease.
2550
2634
  Every runner attach appears chronologically with its recorded runtime (version,
2551
2635
  commit, source kind/location), or `runtime unrecorded` for historical attaches;
2552
2636
  JSON exposes nullable runtime in `runnerAttaches`. Phases belong to the preceding
2553
- attach boundary.
2637
+ attach boundary. A build created with a [role profile](#profiles) shows a
2638
+ `profile:` line (`profile` in JSON), marked no longer configured when a reload
2639
+ removed it; a build without one shows neither.
2554
2640
  For an open PR, the current work-owner decision reads the build-owned
2555
2641
  configuration from the store's deposited `build-runner-effective-config`
2556
2642
  artifact — deposited at every runner launch and refreshed on effective-config
@@ -2642,10 +2728,13 @@ The default watch reports actionable conditions only:
2642
2728
  - `integration.verification-failed`: failed node verification, once per prepared cycle, with failed steps, verified head and parent, and guidance to file a repair child targeting the node. Recovery reports only the latest prepared cycle while its head and parent remain current; superseded failures are not backfilled.
2643
2729
 
2644
2730
  - `build.janitor-failing`: a build has failed janitor attempts for the configured attention threshold. A successful attempt clears it.
2731
+ - `build.janitor-escalated`: a build's janitor failure episode outlasted the escalation threshold and raised one escalation. The janitor keeps retrying; a successful attempt closes it unanswered, and a bare retry answer attempts on the next tick.
2645
2732
  - `dispatcher.forge-persistent`: forge degradation remains after a post-reset retry tick; recovery clears the episode.
2646
2733
 
2647
2734
  - Build `escalation.raised` or `phase.deferral-escalated`: an operator answer
2648
2735
  is required. A read deferral asks for CLI/store repair before retry or guidance.
2736
+ A `build.janitor-escalated` escalation needs no answer to recover; a bare
2737
+ retry answer only brings the next attempt forward.
2649
2738
  - Build `build.merge-decision`: a finalized open PR
2650
2739
  with a recorded consent decision awaiting consent, an explicit hold, or a
2651
2740
  current actionable merge-gate deferral. Policy decisions not yet recorded and
@@ -2653,7 +2742,18 @@ The default watch reports actionable conditions only:
2653
2742
  - Repository `harvest.escalated`, `harvest.recovery-exhausted`,
2654
2743
  `dispatcher.config-rejected`, `dispatcher.config-reloaded` with nonempty
2655
2744
  `restartRequired`, `dispatcher.upgrade-failed`, `dispatcher.runtime-rolled-back`,
2656
- `dispatcher.kernel-git-unavailable`, abnormal `dispatcher.run-stopped`, and `dispatcher.lost`.
2745
+ `dispatcher.kernel-git-unavailable`, `forge.credential-limited`, abnormal
2746
+ `dispatcher.run-stopped`, and `dispatcher.lost`. A `forge.credential-limited`
2747
+ line names the process whose GitHub request was rate-limited outside the
2748
+ dispatcher's credential (unauthenticated, with why, or on that process's own
2749
+ credential) and its reset; dispatcher forge work continues.
2750
+ - Repository `ticket-preparation.resolved` with outcome `abandoned`: automatic
2751
+ preparation recovery stopped and left the ticket unchanged. The line names the
2752
+ ticket, attempt and recorded reason; the payload's `claimed` says whether the
2753
+ claim was confirmed. An unconfirmed claim's provider outcome is unknown, and
2754
+ events written before `claimed` existed report the certainty as not recorded.
2755
+ Each abandonment reports once as it lands; a fresh watch does not replay
2756
+ historical ones, and nothing clears or acknowledges it.
2657
2757
  - `dispatcher.ticket-source-persistent`: degradation past its advertised
2658
2758
  reset time, once a tick started at or after reset has completed or failed
2659
2759
  with the episode still open; crossing reset alone is silent. Without a reset,
@@ -3086,25 +3186,37 @@ not consume `maxPhaseAttempts`. A seventh transient failure records
3086
3186
  error and six retries. Answering that escalation opens a fresh publication episode
3087
3187
  for the same retained intent without resetting agent phase failures. Pending
3088
3188
  publication keeps its workspace through backoff and unresolved exhaustion.
3089
- Classified rate limits retain repository cooldown and consume no publication
3189
+ Dispatcher-classified rate limits retain repository cooldown and consume no publication
3090
3190
  retry allowance. Rejected pushes, lease conflicts, dirty trees and unclassified
3091
3191
  errors retain their existing behavior.
3092
3192
 
3093
3193
  Janitor failures are durable per-build episodes. Eligible failures retry after
3094
3194
  30, 60, 120, 240 seconds, then at the configured cap (300 seconds by default).
3095
3195
  A classified forge rate limit is repository cooldown, not a janitor failure:
3096
- neither the first limited response nor the cooldown that follows starts or ages
3097
- an episode. Skipped polls preserve the episode across restart. After
3098
- `policy.janitorFailureAttentionSeconds` (600 by default), `build.janitor-failing`
3099
- notifies default watchers and appears on the build row. A successful attempt
3100
- clears it. `policy.janitorBackoffMaxSeconds` sets the positive integer cap.
3196
+ neither the first limited response nor the cooldown that follows starts an
3197
+ episode or records an attempt, so a build that only waits out cooldown never
3198
+ escalates. Skipped polls preserve the episode across restart. Both thresholds
3199
+ below are wall-clock from the episode's first failed attempt and are checked
3200
+ when an attempt fails, so cooldown inside an episode that already started still
3201
+ counts. After `policy.janitorFailureAttentionSeconds` (600 by default),
3202
+ `build.janitor-failing` notifies default watchers and appears on the build row.
3203
+ After `policy.janitorFailureEscalationSeconds` (3600 by default), the build
3204
+ raises one escalation through `build.janitor-escalated`, naming the failing
3205
+ operation, the last error, the failed attempt count and when the episode
3206
+ started. The build is then blocked and shows wherever open escalations show.
3207
+ The janitor keeps retrying on its backoff underneath; a successful attempt
3208
+ clears the attention, closes the escalation unanswered and the build continues.
3209
+ Answering it with a bare retry makes the janitor attempt on its next tick. An
3210
+ episode raises at most one escalation; a new episode after recovery can raise
3211
+ another. `policy.janitorBackoffMaxSeconds` sets the positive integer cap.
3101
3212
  A dispatcher that cannot execute Git for kernel node work (a missing or
3102
3213
  unloadable `git` for the bare clone) records no janitor failures. It records
3103
3214
  one durable `dispatcher.kernel-git-unavailable` repository condition, node work
3104
3215
  waits, and `dispatcher.kernel-git-recovered` closes the condition once a clone
3105
3216
  succeeds.
3106
3217
 
3107
- A classified forge rate limit records repository degradation with `resetAt`.
3218
+ A rate limit the dispatcher classifies on its own authenticated request
3219
+ records repository degradation with `resetAt`.
3108
3220
  Forge work waits during cooldown; passing the deadline permits a recovery
3109
3221
  request; a successful probe records automatic recovery. An authorized operator
3110
3222
  may explicitly override erroneous recorded state with
@@ -3115,6 +3227,25 @@ success. A subsequent actual limit records a fresh cooldown. Hosted admission
3115
3227
  requires a schema-valid finite ISO `resetAt` no later than server time plus
3116
3228
  24 hours, inclusive; past deadlines remain valid. Rejection never clamps or
3117
3229
  invents a provider reset, and historical events remain readable.
3230
+
3231
+ Only the dispatcher's own forge pauses the repository. A limit on a request
3232
+ that carried no credential, or one seen by a build runner or phase session,
3233
+ says nothing about the dispatcher's credential: that process waits out its own
3234
+ reset locally (a dispatcher defers that work instead), and records one advisory
3235
+ `forge.credential-limited` fact per episode naming the process, whether the
3236
+ request was `unauthenticated` (with why) or used the process's own credential,
3237
+ and the reset. It is `ab watch` attention and appears as
3238
+ `forgeCredentialLimits` in `ab repository status` until its reset;
3239
+ `forge-clear` does not apply. Remote guests receive no forge credential: their
3240
+ GitHub API requests fail with a typed error naming `GITHUB_TOKEN or GH_TOKEN`
3241
+ instead of going out anonymously, and they prove ancestry through their
3242
+ workspace's Git. An unauthenticated limit therefore points at a process missing
3243
+ `GITHUB_TOKEN`/`GH_TOKEN` or a `gh` login, or at guest-side forge use that must
3244
+ run kernel-side. Runners and sessions still wait out a dispatcher-recorded
3245
+ cooldown, but a limit they hit on a shared token no longer pauses the
3246
+ dispatcher in advance; the dispatcher records it on its own next limited
3247
+ request.
3248
+
3118
3249
  Native merge application failures keep candidate-specific retry eligibility,
3119
3250
  including automatic decisions without a human command. Retries recheck consent,
3120
3251
  holds, verification and the exact candidate. Uncertain enables remain pending
@@ -88,7 +88,7 @@ raw session-event append. External operator harnesses own agent execution.
88
88
  | `GET …/status` | Repository intake, pause, and default-auto-merge projection. Its `operator` is `{presence: "unavailable", reason}`: this route does not load presence registrations, so it is not evidence that no operator is present. |
89
89
  | `GET …/harvest/status` | Harvest gate, runs, steps, recovery, and attention projection. |
90
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. |
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 default: dispatch order, urgent tickets first, then the source order) or `newest` (newest filed first); `total` counts every match before paging. |
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 default: dispatch order, urgent tickets first, then the source order) or `newest` (newest filed first, regardless of urgency; see paging below); `total` counts every match before paging. |
92
92
  | `GET …/tickets/states` | Full state metadata `{name,tickets,about?}[]`, including empty states (`tickets.states` in MCP). |
93
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. |
94
94
 
@@ -132,8 +132,8 @@ JSON bodies are strict: unknown fields are rejected.
132
132
  | `POST …/bulk-control` | `{"action":"pause"\|"resume"}`. The hold fact, intake fact, then eligible build events are written in that order. |
133
133
  | `POST …/harvest/control` | `{"action":"toggle-gate"}` or `{"action":"run","run":"…"}`. A run action is bound to that concrete projected run. |
134
134
  | `POST …/tickets/states` | `{name,about?}` → `{state,created}`; requires attributed operator identity (`tickets.state.create` in MCP). Hosted duplicate names are refused case-insensitively. |
135
- | `POST …/tickets` | `{"title":"…","body":"…","labels"?:[],"state"?:"…","blockedBy"?:[],"issueLinks"?:[{"issue":N,"intent"?:"closes"|"refs"}],"priority"?:"urgent"|"normal","kind"?:"work"|"node","target"?:"id"|null}`; omitted state preserves the backend default, omitted intent is `closes`, and omitted priority is normal. A backend that cannot store issue links refuses with `code: "issue-links-unsupported"`; one that cannot store priority refuses `urgent` with `code: "priority-unsupported"` and accepts `normal` as a no-op. |
136
- | `PATCH …/tickets/{id}` | Any nonempty subset of `title`, `body`, complete-replacement `labels`, complete-replacement `issueLinks` (`[]` clears), `priority` (`urgent` or `normal`; refusals as for create), `kind` (`work` or `node`), and nullable `target` (null clears). Body bytes are not normalized. |
135
+ | `POST …/tickets` | `{"title":"…","body":"…","labels"?:[],"state"?:"…","blockedBy"?:[],"issueLinks"?:[{"issue":N,"intent"?:"closes"|"refs"}],"priority"?:"urgent"|"normal","assignees"?:["login"|"me"],"kind"?:"work"|"node","target"?:"id"|null}`; omitted state preserves the backend default, omitted intent is `closes`, omitted priority is normal, and omitted assignees apply `[tickets].createAssignee` (`[]` creates an unassigned ticket). `assignees` takes at most ten entries, counted before duplicates collapse, and more is a validation error. A backend that cannot store issue links refuses with `code: "issue-links-unsupported"`; one that cannot store priority refuses `urgent` with `code: "priority-unsupported"` and accepts `normal` as a no-op; one that cannot store assignees refuses any `assignees` with `code: "assignees-unsupported"`. |
136
+ | `PATCH …/tickets/{id}` | Any nonempty subset of `title`, `body`, complete-replacement `labels`, complete-replacement `issueLinks` (`[]` clears), `priority` (`urgent` or `normal`; refusals as for create), complete-replacement `assignees` (`[]` clears; refusals as for create), `kind` (`work` or `node`), and nullable `target` (null clears). Body bytes are not normalized. |
137
137
  | `POST …/tickets/{id}/move` | Exactly one of `{"state":"backend state name"}` or `{"role":"triage"\|"ready"\|"backlog"\|"rejected"}`; both or neither is `400 validation` (`tickets.move` in MCP takes the same target). A role resolves to the configured `triageState`, `readyState`, `backlogState`, or `rejectedState`. An unset `backlogState` or `rejectedState` refuses with a message naming the key to set, and never guesses a native state. A source that can create states creates a missing role state before moving. |
138
138
  | `POST …/tickets/{id}/block` | `{"blockerIds":["…"]}`. |
139
139
  | `POST …/tickets/{id}/unblock` | `{"blockerIds":["…"]}`. |
@@ -268,6 +268,9 @@ expiry. Successor loss and upgrade-failure/rollback attention remain independent
268
268
  `observation` instead of `event`, with run, observedAt, leaseExpiresAt and available
269
269
  identity, plus the usual repo/build/state/cursor fields. It invents no durable
270
270
  sequence or actor. Retain the cursor to avoid repeat reports across invocations.
271
+ A loss can be transient: a holder that stalled past
272
+ `policy.dispatchLeaseTimeoutSeconds` with no successor reclaims its lease on
273
+ waking and returns to `held`.
271
274
  A watch retains sampled owners after authoritative lease release. Once-run teardown
272
275
  stops heartbeat and releases only its own lease; release is best effort because
273
276
  expiry fences ambiguous ownership. A retained sample or failed release cannot
@@ -282,6 +285,7 @@ The default watch reports actionable conditions only:
282
285
  - `integration.verification-failed`: failed node verification, once per prepared cycle, with failed steps, verified head and parent, and guidance to file a repair child targeting the node. Recovery reports only the latest prepared cycle while its head and parent remain current; superseded failures are not backfilled.
283
286
 
284
287
  - `build.janitor-failing`: a build has reached the configured consecutive-failure threshold; a successful janitor attempt clears it.
288
+ - `build.janitor-escalated`: a build's janitor failure episode outlasted `policy.janitorFailureEscalationSeconds` and raised one escalation naming the operation, last error, attempt count and episode start. The janitor keeps retrying; a successful attempt closes the escalation, and a bare retry answer attempts on the next tick.
285
289
  - `dispatcher.forge-persistent`: forge degradation remains after a completed post-reset retry opportunity; successful recovery clears it.
286
290
 
287
291
  - Build `escalation.raised`, `integration.landed`, `node.item-conflicted`, `target.rewritten`, or
@@ -294,7 +298,18 @@ The default watch reports actionable conditions only:
294
298
  - Repository `harvest.escalated`, `harvest.recovery-exhausted`,
295
299
  `dispatcher.config-rejected`, `dispatcher.config-reloaded` with nonempty
296
300
  `restartRequired`, `dispatcher.upgrade-failed`, `dispatcher.runtime-rolled-back`,
297
- `dispatcher.kernel-git-unavailable`, abnormal `dispatcher.run-stopped`, and `dispatcher.lost`.
301
+ `dispatcher.kernel-git-unavailable`, `forge.credential-limited`, abnormal
302
+ `dispatcher.run-stopped`, and `dispatcher.lost`. A `forge.credential-limited`
303
+ line names the process whose GitHub request was rate-limited outside the
304
+ dispatcher's credential (unauthenticated, with why, or on that process's own
305
+ credential) and its reset; dispatcher forge work continues.
306
+ - Repository `ticket-preparation.resolved` with outcome `abandoned`: automatic
307
+ preparation recovery stopped and left the ticket unchanged. The line names the
308
+ ticket, attempt and recorded reason; the payload's `claimed` says whether the
309
+ claim was confirmed. An unconfirmed claim's provider outcome is unknown, and
310
+ events written before `claimed` existed report the certainty as not recorded.
311
+ Each abandonment reports once as it lands; a fresh watch does not replay
312
+ historical ones, and nothing clears or acknowledges it.
298
313
  - `dispatcher.ticket-source-persistent`: degradation past its advertised
299
314
  reset time, once a tick started at or after reset has completed or failed
300
315
  with the episode still open; crossing reset alone is silent. Without a reset,
@@ -377,12 +392,17 @@ HTTP merge controls retain the wire actions `land` and `hold` with acknowledged
377
392
  requires readiness and survives restacks; hold persists until merge. Repository
378
393
  auto-merge settings are retired; configure ordered `[[merge]]` rules.
379
394
 
380
- Default attention includes `build.janitor-failing` and
395
+ Default attention includes `build.janitor-failing`, `build.janitor-escalated` and
381
396
  `dispatcher.forge-persistent`. Raw `dispatcher.forge-degraded` and
382
397
  `dispatcher.forge-recovered` facts are available through explicit event filters.
383
- Active janitor attention clears on a successful attempt. Repository status
398
+ Active janitor attention and an open janitor escalation clear on a successful
399
+ attempt. Repository status
384
400
  includes forge degradation/reset and available request counts; `dispatcher.forge-persistent` requires a completed retry opportunity past
385
401
  the original reset, which later rate limits cannot postpone indefinitely.
402
+ Only the dispatcher's own classified limits record that degradation. Status
403
+ also lists active `forgeCredentialLimits`: limits on unauthenticated requests or
404
+ seen by build runners and phase sessions, each naming the process, which never
405
+ pause repository forge work.
386
406
 
387
407
  ### Node restack request
388
408
 
@@ -568,20 +588,23 @@ permission or retention failures leave deletion pending. Vercel Blob cleanup use
568
588
  the same store identity, token and prefixed pathname as uploads. Missing objects
569
589
  are successful cleanup; provider errors never count as completed deletion.
570
590
 
571
- 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 urgent tickets first, then normal ones, each in source order; for `newest`, the reversed source order. 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.
591
+ 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 urgent tickets first, then normal ones, each in source order; for `newest`, the reversed listing. `newest` means newest filed first, regardless of urgency, with a stable tie-break; it is not the reverse of dispatch order. A source that lists in filing order (file, GitHub, Linear) gets exactly that from the reversed listing. The remote `HostedTicketSource` is the exception: the hosted list-ready protocol returns urgent tickets first and carries no filing time, so its fallback `newest` pages are reversed dispatch order whenever urgent tickets exist. 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.
572
592
 
573
593
 
574
594
  ### Forge cooldown admission and explicit recovery
575
595
 
576
596
  Hosted repository event appends and atomic artifact deposits validate
577
- `dispatcher.forge-degraded` before any durable mutation. The payload must match
578
- its event schema, with a finite ISO `resetAt` at most 24 hours after server time
597
+ `dispatcher.forge-degraded` and `forge.credential-limited` before any durable
598
+ mutation. The payload must match its event schema, with a finite ISO `resetAt` at most 24 hours after server time
579
599
  (inclusive). Already-expired deadlines are accepted. Invalid or out-of-horizon
580
600
  writes return `400 validation` (the remote adapter exposes `EventValidationError`);
581
601
  the server never clamps or invents a provider reset. Historical decoding has no clock-relative restriction.
582
602
 
583
603
  Build-runner and build-phase grants may POST only the kernel-authored
584
- `dispatcher.forge-degraded` repository fact through the events route. The
604
+ `forge.credential-limited` and `dispatcher.forge-degraded` repository facts
605
+ through the events route. Current runners and phase sessions record only
606
+ `forge.credential-limited` attention; the `dispatcher.forge-degraded` exception
607
+ remains for runners pinned to older releases. The
585
608
  preceding `requireProject` check binds this exception to the exact repository
586
609
  in the delegated claim. A hosted project identifies one repository. Delegates
587
610
  cannot write recovery, deposits or other repository facts, regardless of the
@@ -120,6 +120,10 @@ confirmed, absent, or unknown without deleting an environment or its snapshots.
120
120
  Only dispatcher-authorized reap follows the durable fence and preservation/loss
121
121
  receipt. `provision` accepts exact `restoration` heads; branch ancestry must be
122
122
  verified, and detached producer objects must never overwrite the named branch.
123
+ `provision` also receives `restorationArchives`: `local` for the local-git
124
+ forge, whose repository already holds the archive refs and must not be fetched
125
+ from, and `remote` otherwise, in which case a provider sharing the repository
126
+ must fetch each exact archive ref from origin before verifying it.
123
127
  `preserve` receives `replaced`, and `provision` receives `restorationReplaced`:
124
128
  the build's bounded record of the latest 64 shas recorded rewrites replaced.
125
129
  A branch head equal to or contained in one of them is superseded. Preserve
@@ -154,6 +158,9 @@ API 1.8 adds optional forge failure classification. Import `ForgeFailure` and `i
154
158
  ```ts
155
159
  // Rate limit, with a valid ISO reset timestamp:
156
160
  throw new ForgeFailure(message, { kind: 'rate-limited', resetAt })
161
+ // The limited request carried no credential: say why, so the limit stays local
162
+ // to the caller instead of pausing the repository:
163
+ throw new ForgeFailure(message, { kind: 'rate-limited', resetAt, unauthenticated: reason })
157
164
  // Retryable transport error:
158
165
  throw new ForgeFailure(message, { kind: 'transient', retry: 'retryable' })
159
166
  ```
@@ -533,10 +540,12 @@ refuse a configured `readyAssignee` with an error naming the source and plugin.
533
540
  Three optional methods support it:
534
541
 
535
542
  - `prepareReadyAssignee(): Promise<void>` is called once at dispatcher startup,
536
- before the loop and never in a tick, whether or not `readyAssignee` is set.
543
+ before the loop and never in a tick, whether or not `readyAssignee` or
544
+ `createAssignee` is set.
537
545
  Resolve whatever `"me"` needs and memoize it. A credential with no user is a
538
546
  recorded result, not a throw; throw only for infrastructure failures, which
539
- fail startup when `readyAssignee` is set and are otherwise a warning.
547
+ fail startup when `readyAssignee` or `createAssignee` is set and are
548
+ otherwise a warning.
540
549
  - `readyAssigneeRefusal(value): string | undefined` is synchronous and makes no
541
550
  request. Return why the value can't be honoured from what was prepared, or
542
551
  `undefined`. Startup and every reload call it, so a refused reload keeps the
@@ -545,6 +554,29 @@ Three optional methods support it:
545
554
  return a one-line summary of who the value names, such as `me → @octocat`,
546
555
  or throw an error that says how to fix a value that names nobody.
547
556
 
557
+ ## Optional assignees capability
558
+
559
+ An adapter opts in with `assignees: true` and must then accept
560
+ `assignees?: string[]` on create, update and revision-checked update, where
561
+ each entry is a username or `me` (the owner of the source's credential) and an
562
+ update replaces the whole set, `[]` clearing it. Return `assignees` on every
563
+ read, `[]` when unassigned, and leave it out of revisions. Check each user
564
+ before any write and refuse, writing nothing, when one can't be assigned. A
565
+ write the provider accepts without the requested assignees must fail rather
566
+ than report success, and a retried keyed create that adopts an existing ticket
567
+ must leave it with the requested assignees. Without the flag, the
568
+ compatibility facade refuses any write naming assignees, including `[]`, with
569
+ `TicketAssigneesUnsupported` before your methods run, strips them from reads,
570
+ and dispatcher startup, `ab init --validate` and live reloads refuse a
571
+ configured `[tickets].createAssignee`, naming the source and plugin.
572
+
573
+ Callers apply `createAssignee` themselves, so a draft's assignees are always
574
+ exact. To support it, implement `createAssigneeRefusal(value)`, synchronous
575
+ and request-free like `readyAssigneeRefusal`, and
576
+ `describeCreateAssignee(value)` for `ab init --validate`. `"me"` should reuse
577
+ what `prepareReadyAssignee` resolved, so a dispatcher never resolves it in a
578
+ tick.
579
+
548
580
  ## Optional ticket paging capability
549
581
 
550
582
  Native paging is an optional API 1.9 ticket-source capability:
@@ -552,8 +584,11 @@ Native paging is an optional API 1.9 ticket-source capability:
552
584
  The SDK exports these types; the result is `TicketListing & { total: number }`.
553
585
  Criteria retain state, labels (AND), and assignee semantics. The page has a
554
586
  nonnegative integer `limit`, optional nonnegative integer `offset` (default 0),
555
- and optional `order: 'oldest' | 'newest'` (default oldest). Newest reverses the
556
- entire source order before offset and limit. Total counts all matches, even
587
+ and optional `order: 'oldest' | 'newest'` (default oldest). Oldest is the
588
+ source's dispatch order: with `priority`, urgent tickets first, then normal
589
+ ones, each in listing order. Newest is newest filed first: creation time
590
+ descending, regardless of urgency, with a stable tie-break. It is not the
591
+ reverse of dispatch order. Offset and limit apply after ordering. Total counts all matches, even
557
592
  with limit zero or an offset past the end. Records, diagnostics and errors
558
593
  match the exhaustive listing. The shared `describeTicketSourceContract` suite
559
594
  automatically compares declared native paging with full-read windows.
@@ -561,7 +596,12 @@ automatically compares declared native paging with full-read windows.
561
596
  Only paged operator listings select this capability. Sources without it retain
562
597
  the full-read fallback, which orders the listing before offset and limit: by
563
598
  default a stable urgent-first partition (urgent, then normal, each in source
564
- order), or for newest the reversed source order. Native errors propagate. Unpaged operator
599
+ order), or for newest the reversed listing, which is newest filed first for
600
+ sources that list in filing order (file, GitHub, Linear). The remote
601
+ `HostedTicketSource` is the exception: the hosted list-ready protocol returns
602
+ urgent tickets first and carries no filing time, so the client cannot see
603
+ filing order, and its newest pages are reversed dispatch order whenever urgent
604
+ tickets exist. Native errors propagate. Unpaged operator
565
605
  listings, CLI ticket lists and dispatcher ready scans remain exhaustive through
566
606
  `listReady`/`listAll`. The hosted PostgreSQL source counts matches without
567
607
  bodies and reads only the SQL-bounded window. File, Linear, GitHub and the remote
@@ -570,4 +610,6 @@ bodies and reads only the SQL-bounded window. File, Linear, GitHub and the remot
570
610
  Hosted cooldown recording rejects observed reset deadlines beyond the 24-hour
571
611
  admission horizon explicitly; adapters must not shorten or invent a provider
572
612
  reset to evade this validation. Operator forge-clear is an audited override,
573
- not a successful provider observation.
613
+ not a successful provider observation. Only limits the dispatcher's own forge
614
+ classifies, without `unauthenticated`, record repository cooldown; others are
615
+ local to the process and reported as `forge.credential-limited` attention.