@defrex/autobuild 1.4.2 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/SPEC.md +432 -92
- package/bin/ab-dispatch-kernel.ts +1 -0
- package/docs/accounts.md +9 -0
- package/docs/agent-runtimes.md +1 -0
- package/docs/answering-blocked-builds.md +2 -1
- package/docs/architecture.md +282 -127
- package/docs/assets/headline-wide.png +0 -0
- package/docs/build-store.md +33 -3
- package/docs/cli.md +2 -1
- package/docs/configuration-overview.md +9 -0
- package/docs/configuration.md +163 -102
- package/docs/dispatcher-hosting.md +19 -3
- package/docs/dispatcher.md +9 -4
- package/docs/integration-overview.md +2 -2
- package/docs/integration-tree.md +91 -28
- package/docs/merge-policy.md +28 -9
- package/docs/operator-api.md +43 -18
- package/docs/operator-surfaces.md +1 -1
- package/docs/plugin-authoring.md +85 -8
- package/docs/remote-store-protocol.md +25 -7
- package/docs/remote-ticket-protocol.md +126 -12
- package/docs/restacking.md +20 -6
- package/docs/seams.md +2 -2
- package/docs/setup.md +19 -13
- package/docs/spec-standard.md +2 -1
- package/docs/ticket-dependencies.md +26 -8
- package/docs/ticket-migration.md +70 -7
- package/docs/ticket-sources.md +82 -5
- package/docs/tickets.md +34 -2
- package/docs/troubleshooting.md +2 -2
- package/docs/verification.md +5 -5
- package/docs/website.md +8 -0
- package/docs/workspaces.md +1 -1
- package/package.json +4 -3
- package/packages/core/src/accounts/hosted-readiness.ts +21 -0
- package/packages/core/src/cli/attention.ts +1 -0
- package/packages/core/src/cli/build-control.ts +36 -12
- package/packages/core/src/cli/connect.ts +9 -18
- package/packages/core/src/cli/context.ts +44 -0
- package/packages/core/src/cli/dashboard/configuration.ts +11 -0
- package/packages/core/src/cli/dashboard/model.ts +40 -10
- package/packages/core/src/cli/dashboard/queue.ts +21 -0
- package/packages/core/src/cli/dashboard/render.ts +40 -22
- package/packages/core/src/cli/dispatch-frontend.ts +63 -30
- package/packages/core/src/cli/dispatch-mode.ts +35 -16
- package/packages/core/src/cli/dispatch-repository-feed.ts +40 -11
- package/packages/core/src/cli/dispatch.ts +154 -47
- package/packages/core/src/cli/help.ts +59 -22
- package/packages/core/src/cli/init-hosted-accounts.ts +54 -0
- package/packages/core/src/cli/init-readiness-remote.ts +16 -3
- package/packages/core/src/cli/init-validation.ts +144 -42
- package/packages/core/src/cli/issue-links.ts +67 -0
- package/packages/core/src/cli/main.ts +32 -15
- package/packages/core/src/cli/pr-summary-publication.ts +38 -7
- package/packages/core/src/cli/publication-settlement.ts +36 -24
- package/packages/core/src/cli/repository-status.ts +201 -49
- package/packages/core/src/cli/status.ts +41 -3
- package/packages/core/src/cli/terminals.ts +37 -2
- package/packages/core/src/cli/ticket-editor.ts +20 -6
- package/packages/core/src/cli/ticket.ts +264 -46
- package/packages/core/src/cli/triage-count-sampler.ts +59 -0
- package/packages/core/src/cli/watch.ts +4 -0
- package/packages/core/src/config/live.ts +45 -4
- package/packages/core/src/config/load.ts +9 -0
- package/packages/core/src/config/pipeline-source.ts +6 -2
- package/packages/core/src/config/ready-assignee.ts +86 -0
- package/packages/core/src/config/schema.ts +164 -36
- package/packages/core/src/distribution-packaging.ts +1 -1
- package/packages/core/src/events/catalog.ts +5 -0
- package/packages/core/src/events/compatibility.ts +2 -1
- package/packages/core/src/events/payloads.ts +70 -0
- package/packages/core/src/events/policy.ts +8 -0
- package/packages/core/src/events/repository.ts +91 -28
- package/packages/core/src/kernel/__snapshots__/reducer-accumulator-shapes.json +41 -0
- package/packages/core/src/kernel/build-identity.ts +12 -0
- package/packages/core/src/kernel/change-presence.ts +139 -6
- package/packages/core/src/kernel/dispatch-capacity.ts +80 -14
- package/packages/core/src/kernel/dispatch-status.ts +10 -1
- package/packages/core/src/kernel/dispatch-upgrade.ts +104 -5
- package/packages/core/src/kernel/engine.ts +4 -2
- package/packages/core/src/kernel/finalize-pr-rejection.ts +95 -0
- package/packages/core/src/kernel/generators/repository-journals.ts +15 -1
- package/packages/core/src/kernel/harvest.ts +4 -1
- package/packages/core/src/kernel/integration-completeness.ts +104 -17
- package/packages/core/src/kernel/integration-landing.ts +17 -0
- package/packages/core/src/kernel/integration-state.ts +17 -0
- package/packages/core/src/kernel/issue-keywords.ts +202 -0
- package/packages/core/src/kernel/janitor-failure.ts +11 -0
- package/packages/core/src/kernel/kernel-git.ts +87 -0
- package/packages/core/src/kernel/landing-readiness.ts +25 -17
- package/packages/core/src/kernel/log-index.ts +1 -1
- package/packages/core/src/kernel/node-issue-links.ts +142 -0
- package/packages/core/src/kernel/node-parent.ts +6 -0
- package/packages/core/src/kernel/node-restack-transaction.ts +2 -0
- package/packages/core/src/kernel/pr-summary.ts +24 -0
- package/packages/core/src/kernel/read-deferrals.ts +75 -12
- package/packages/core/src/kernel/read-facts.ts +32 -1
- package/packages/core/src/kernel/reconcile-restack.ts +1 -1
- package/packages/core/src/kernel/reducer-registry.ts +31 -1
- package/packages/core/src/kernel/reducer.ts +90 -2
- package/packages/core/src/kernel/ticket-preparation.ts +12 -0
- package/packages/core/src/kernel/verify-budget.ts +43 -0
- package/packages/core/src/operator/index.ts +3 -1
- package/packages/core/src/operator/presentation.ts +3 -0
- package/packages/core/src/operator/protocol.ts +38 -2
- package/packages/core/src/operator/query.ts +66 -29
- package/packages/core/src/operator/registry.ts +47 -26
- package/packages/core/src/operator/tickets.ts +77 -10
- package/packages/core/src/plugin-sdk/index.ts +13 -0
- package/packages/core/src/plugins/manifest.ts +1 -1
- package/packages/core/src/plugins/registry.ts +1 -0
- package/packages/core/src/ports/forge/contract.ts +69 -0
- package/packages/core/src/ports/forge/create.ts +5 -0
- package/packages/core/src/ports/forge/fake.ts +184 -3
- package/packages/core/src/ports/forge/git-rewrite.ts +4 -2
- package/packages/core/src/ports/forge/github.ts +175 -38
- package/packages/core/src/ports/forge/local-git.ts +14 -0
- package/packages/core/src/ports/forge/readiness.ts +10 -0
- package/packages/core/src/ports/forge-failure.ts +43 -0
- package/packages/core/src/ports/runner/claude.ts +7 -1
- package/packages/core/src/ports/runner/codex.ts +7 -2
- package/packages/core/src/ports/runner/native-cli-fixture.ts +2 -1
- package/packages/core/src/ports/runner/pi.ts +7 -1
- package/packages/core/src/ports/runner/runtime.ts +3 -0
- package/packages/core/src/ports/runner/start-prompt.ts +37 -0
- package/packages/core/src/ports/tickets/contract.ts +320 -7
- package/packages/core/src/ports/tickets/create.ts +72 -17
- package/packages/core/src/ports/tickets/fake.ts +18 -0
- package/packages/core/src/ports/tickets/file-codec.ts +20 -0
- package/packages/core/src/ports/tickets/file.ts +43 -1
- package/packages/core/src/ports/tickets/github-fake.ts +1123 -0
- package/packages/core/src/ports/tickets/github-issues.ts +431 -0
- package/packages/core/src/ports/tickets/github-validators.ts +194 -0
- package/packages/core/src/ports/tickets/github.ts +2029 -0
- package/packages/core/src/ports/tickets/hosted-index.ts +34 -3
- package/packages/core/src/ports/tickets/issue-links.ts +86 -0
- package/packages/core/src/ports/tickets/lifecycle.ts +60 -4
- package/packages/core/src/ports/tickets/linear.ts +66 -6
- package/packages/core/src/ports/tickets/migration.ts +290 -68
- package/packages/core/src/ports/tickets/operations.ts +98 -12
- package/packages/core/src/ports/tickets/priority.ts +55 -0
- package/packages/core/src/ports/tickets/remote-protocol.ts +195 -29
- package/packages/core/src/ports/tickets/remote.ts +188 -13
- package/packages/core/src/ports/tickets/revision.ts +22 -1
- package/packages/core/src/ports/tickets/states.ts +43 -0
- package/packages/core/src/ports/tickets/tree.ts +58 -12
- package/packages/core/src/ports/tickets/update.ts +12 -2
- package/packages/core/src/ports/types.ts +190 -9
- package/packages/core/src/ports/workspace/commit-preservation.ts +135 -13
- package/packages/core/src/ports/workspace/git-worktree.ts +3 -1
- package/packages/core/src/ports/workspace/vercel-sandbox.ts +118 -27
- package/packages/core/src/processes/build-runner.ts +99 -21
- package/packages/core/src/processes/dispatcher.ts +822 -338
- package/packages/core/src/processes/execution-no-progress.ts +5 -0
- package/packages/core/src/processes/harvest-runner.ts +17 -8
- package/packages/core/src/processes/harvest.ts +5 -8
- package/packages/core/src/processes/tick-publication.ts +12 -2
- package/packages/core/src/processes/ticket-scan-schedule.ts +78 -0
- package/packages/core/src/processes/workspace-preservation.ts +36 -1
- package/packages/core/src/runtime-identity.ts +10 -2
- package/packages/core/src/scenarios/harness.ts +4 -0
- package/packages/core/src/store/adapter.ts +7 -1
- package/packages/core/src/store/contract.ts +83 -2
- package/packages/core/src/store/digest.ts +32 -1
- package/packages/core/src/store/reducer-value-shapes.json +4187 -3391
- package/packages/core/src/store/remote/protocol.ts +2 -0
- package/packages/core/src/store/remote/released-clients.json +11 -0
- package/packages/core/src/store/remote/released-reducer-values/1.5.0.json +26924 -0
- package/packages/core/src/store/remote/released-reducer-values/index.ts +2 -0
- package/packages/core/src/store/repo-state-events.ts +2 -0
- package/packages/core/src/store/types.ts +5 -0
- package/packages/core/src/testing/dispatch-read-budget.ts +729 -123
- package/packages/core/src/testing/index.ts +18 -1
- package/packages/core/src/testing/presence-history.ts +79 -0
- package/packages/core/src/testing/reduced-read-budget.ts +1085 -31
- package/packages/core/src/testing/upgrade-generations.ts +77 -0
- package/skills/code-review/SKILL.md +4 -3
- package/skills/finalize/SKILL.md +18 -2
- package/skills/guide/SKILL.md +374 -136
- package/skills/guide/references/accounts.md +9 -0
- package/skills/guide/references/integration-tree.md +91 -28
- package/skills/guide/references/merge-policy.md +28 -9
- package/skills/guide/references/operator-api.md +43 -18
- package/skills/guide/references/plugin-authoring.md +85 -8
- package/skills/guide/references/remote-store-protocol.md +25 -7
- package/skills/guide/references/remote-ticket-protocol.md +126 -12
- package/skills/guide/references/restacking.md +20 -6
- package/skills/guide/references/setup.md +19 -13
- package/skills/guide/references/spec-standard.md +2 -1
- package/skills/guide/references/ticket-dependencies.md +26 -8
- package/skills/guide/references/ticket-migration.md +70 -7
- package/skills/harvest-review/SKILL.md +4 -3
- package/skills/implement/SKILL.md +20 -1
- package/skills/operate/SKILL.md +103 -28
- package/skills/plan/SKILL.md +1 -1
- package/skills/reconcile/SKILL.md +5 -4
- package/skills/spec/SKILL.md +15 -2
- package/skills/tickets/SKILL.md +114 -37
- package/templates/autobuild.toml +5 -0
- package/templates/hosted-service/package.json +2 -2
package/docs/plugin-authoring.md
CHANGED
|
@@ -42,7 +42,7 @@ Wrap an `AgentRunner` that supports:
|
|
|
42
42
|
- typed failures: verbatim message, retry-compatible `permanent` bit, optional `cause: availability | exhaustion | credentials | configuration` routing evidence
|
|
43
43
|
- the distribution-managed `ab` launcher
|
|
44
44
|
|
|
45
|
-
Declare served model prefixes and a default. Optional tool-free `oneShot` sits beside the runner interface.
|
|
45
|
+
Declare served model prefixes and a default. Optional tool-free `oneShot` sits beside the runner interface. An optional `startPrompt(opts)` returns the exact first message `start` sends, which the kernel records on `session.started`.
|
|
46
46
|
|
|
47
47
|
### `workspace-provider`
|
|
48
48
|
|
|
@@ -55,6 +55,7 @@ Declare served model prefixes and a default. Optional tool-free `oneShot` sits b
|
|
|
55
55
|
- Kernel-owned regular pushes, idempotent PR opening, PR-state projection, gated and ungated auto-merge, head-guarded squash merge, and comments. Agents never receive forge credentials or push.
|
|
56
56
|
- API 1.2: optional idempotent `closePr` and `deleteBranch` for abort cleanup. `closePr` must preserve a racing merge. Without them, cleanup stays visibly pending.
|
|
57
57
|
- Optional `prAttachments` hosts images; the text-only path must work without it.
|
|
58
|
+
- Optional `closesIssues: true` declares that closing keywords reaching the default branch close issues. Only then does the kernel pass `issueLinks` (`{ issue, intent }[]`). For a leaf aimed at the default branch it passes the build's sealed links to `openPr` and in `BuildLandingOptions` to `setAutoMerge` and `squashMerge`. Compose them with the SDK helpers: `neutralizeClosingReferences(title, links, { repository })` for the PR title and squash headline, `withIssueKeywords(body, links, { repository, trailers: false })` for the PR body so it ends with the `Closes #N` / `Refs #N` lines, and `landingMessage(message, buildSlug, links, { repository })` for the landed message, which puts the keyword paragraph before the trailer block. `repository` is `owner/name`, so qualified references to other repositories are left alone. Compare an already-applied landing request against the same composition, or auto-merge churns. The kernel calls `setAutoMerge(…, true, options)` on every eligible poll while a request is armed: return `applied` without mutating when the armed method and message match, and call `options.canApply()` before any mutation that repairs them. Without the flag no links are passed and none are written. A leaf aimed at a node passes its links to `openPr` with every intent `refs` (and none to the landing calls), a root node's PR receives the node's own links merged with its landed children's union, and a nested node's PR receives that set with every intent `refs`. When `openPr` adopts an existing open PR for the head and links are present, converge it: neutralize the existing title, recompose the existing body with `withIssueKeywords`, write only the fields that changed, and confirm by readback, without replacing the title, prose or merge message. To keep a node's PR current, implement the optional `updatePrIssueLinks(workspacePath, number, issueLinks)`: read the PR, neutralize its title and compose its body with `withIssueKeywords(body, links, { repository, trailers: false })`, write only when either changed, re-read and throw when the readback disagrees or the PR is not open. Without the method a node's set is recorded but never written.
|
|
58
59
|
|
|
59
60
|
### Reconcile rewrites
|
|
60
61
|
|
|
@@ -65,8 +66,10 @@ Reconcile requires the optional grouped `Forge.rewrite` capability:
|
|
|
65
66
|
archives also publish commits present only on the remote: GitHub uses create-only
|
|
66
67
|
Git-reference REST creation when the workspace lacks the commit, retaining guarded
|
|
67
68
|
Git pushes for local objects. Exact remote readback confirms publication, then a
|
|
68
|
-
|
|
69
|
-
restores missing commits and
|
|
69
|
+
non-shallow fetch of only that exact archive ref (without tags, configured refmap
|
|
70
|
+
expansion or a depth limit) restores missing commits and their missing ancestry,
|
|
71
|
+
writes no shallow boundary, leaves an already-shallow repository's existing
|
|
72
|
+
boundaries unchanged, and verifies the commits locally before returning.
|
|
70
73
|
3. Replace the explicit branch, leased on an explicit expected remote head.
|
|
71
74
|
|
|
72
75
|
- Return `lease-mismatch` separately from transport, auth and policy failures.
|
|
@@ -86,6 +89,15 @@ authentication, malformed responses or rate limits. Missing capability withholds
|
|
|
86
89
|
new replay requiring proof. GitHub uses exact-SHA comparison; local-git requires
|
|
87
90
|
an explicit served `repoRoot`. Unknown ancestry never authorizes replay.
|
|
88
91
|
|
|
92
|
+
The optional `remoteBranchExists(branch)` returns false only for proven absence
|
|
93
|
+
and throws on failure. Dispatch uses it at claim time to skip slugs whose build
|
|
94
|
+
branch another store already published, and to recognize a target node branch
|
|
95
|
+
another store opened. A throw during slug selection fails that claim: no build
|
|
96
|
+
is created and the ticket is handed back to retry on a later tick, never named
|
|
97
|
+
without the check. A throw while diagnosing a target node leaves the plain
|
|
98
|
+
pending diagnostic. Without the capability, slugs are deduplicated against the
|
|
99
|
+
local store only and the dispatcher records a startup warning.
|
|
100
|
+
|
|
89
101
|
Stores may expose `getNodeRewrite(node, previousHead, beforePrevious)` as a bounded point
|
|
90
102
|
lookup of a durable `node.rewritten` receipt. Built-in adapters index these
|
|
91
103
|
validated publication facts atomically with append, including transactional
|
|
@@ -108,6 +120,16 @@ confirmed, absent, or unknown without deleting an environment or its snapshots.
|
|
|
108
120
|
Only dispatcher-authorized reap follows the durable fence and preservation/loss
|
|
109
121
|
receipt. `provision` accepts exact `restoration` heads; branch ancestry must be
|
|
110
122
|
verified, and detached producer objects must never overwrite the named branch.
|
|
123
|
+
`preserve` receives `replaced`, and `provision` receives `restorationReplaced`:
|
|
124
|
+
the build's bounded record of the latest 64 shas recorded rewrites replaced.
|
|
125
|
+
A branch head equal to or contained in one of them is superseded. Preserve
|
|
126
|
+
archives it only as a producer; provision skips it before any branch mutation
|
|
127
|
+
and reports each skipped head, as `contained` or `superseded`, in the result's
|
|
128
|
+
`restorationSkipped`. The dispatcher demotes exact matches itself, so a
|
|
129
|
+
provider that ignores these fields stays safe. `preserve` also receives
|
|
130
|
+
`neverExecuted` when no execution ever started in the environment: a missing
|
|
131
|
+
base, `HEAD`, branch, or candidate object then means nothing to preserve rather
|
|
132
|
+
than an error. A provider that ignores it stays strict, and cleanup fails safely.
|
|
111
133
|
Provision/start failures signal `WorkspaceCleanupRequired` rather than deleting
|
|
112
134
|
or implicitly recreating an existing checkout. A confirmed `snapshot_not_found`
|
|
113
135
|
lookup establishes filesystem absence, while retaining the stale name for
|
|
@@ -184,6 +206,7 @@ A plugin relying on a capability declares an `apiVersion` range containing its v
|
|
|
184
206
|
- **1.7** Workspace factory seams.
|
|
185
207
|
- **1.8** Forge failure classification and request observers.
|
|
186
208
|
- **1.9** Optional native ticket-source paging (`listPage`); older sources retain operator slicing.
|
|
209
|
+
- **1.10** Optional ticket-source ready-assignee capability (`readyAssignee`, with `prepareReadyAssignee`, `readyAssigneeRefusal` and `describeReadyAssignee`); sources without it refuse `[tickets].readyAssignee`. Also optional targeted ticket listing (`listTargeting`); older tree sources are observed through `listAll`.
|
|
187
210
|
|
|
188
211
|
## 2. Create a repository-local module
|
|
189
212
|
|
|
@@ -412,8 +435,9 @@ acme-autobuild-plugin/
|
|
|
412
435
|
└── bun.lock
|
|
413
436
|
```
|
|
414
437
|
|
|
415
|
-
|
|
438
|
+
Replace `<tested-version>` with the exact Autobuild release your contracts passed against: the version `bun add -d --exact @defrex/autobuild` recorded, also the first line of `ab --version`. That output's plugin API line is the version your `apiVersion` range must contain. Keep the peer at that tested release; widen it to a range only after the unchanged contracts pass on each added host.
|
|
416
439
|
|
|
440
|
+
<!-- plugin-authoring-package-manifest:start -->
|
|
417
441
|
```json
|
|
418
442
|
{
|
|
419
443
|
"name": "@acme/autobuild-plugin",
|
|
@@ -426,11 +450,12 @@ This manifest declares only the tested host release (`1.0.0-beta.2`); widen it o
|
|
|
426
450
|
"test": "bun test",
|
|
427
451
|
"prepublishOnly": "bun run typecheck && bun test"
|
|
428
452
|
},
|
|
429
|
-
"devDependencies": { "@defrex/autobuild": "
|
|
430
|
-
"peerDependencies": { "@defrex/autobuild": "
|
|
453
|
+
"devDependencies": { "@defrex/autobuild": "<tested-version>", "typescript": "5.9.3" },
|
|
454
|
+
"peerDependencies": { "@defrex/autobuild": "<tested-version>" },
|
|
431
455
|
"peerDependenciesMeta": { "@defrex/autobuild": { "optional": true } }
|
|
432
456
|
}
|
|
433
457
|
```
|
|
458
|
+
<!-- plugin-authoring-package-manifest:end -->
|
|
434
459
|
|
|
435
460
|
- **Dependencies.** Type-only SDK imports erase, so Autobuild is a dev dependency, not a runtime `dependencies` entry. The optional peer names the tested host without loading a second Autobuild copy. Runtime imports, such as the reference fake, need a runtime dependency; never ship the fake as a production adapter.
|
|
436
461
|
- **Versions.** Package semver is independent of the host range and `apiVersion`. On an incompatible host plugin API, update adapter and contracts, change the range once they pass, and version the package by the user-visible compatibility change.
|
|
@@ -468,8 +493,58 @@ An adapter opts in with `integrationTree: true` and must:
|
|
|
468
493
|
- before writing any mixed patch, including revision-checked writes, validate same-source existence, node kind, self and ancestor cycles, corrupt chains, and demotion of a node with children
|
|
469
494
|
- expose kind and target in revisions
|
|
470
495
|
|
|
496
|
+
Optionally (API 1.10), implement `listTargeting(nodeId: string): Promise<TicketListing>`: every ticket in every state whose target is `nodeId`, exhausting pagination and propagating infrastructure failures. It must equal `listAll()` filtered by `target === nodeId`, with diagnostics only for excluded records it read. Integration observation prefers it, so a node's completeness read can cost what its children cost instead of a full scan; a failure never falls back to `listAll`. The shared `describeTicketSourceContract` suite checks the equality for any source that declares it.
|
|
497
|
+
|
|
471
498
|
Don't opt in unless the source preserves these semantics. Legacy sources get ordinary CRUD; the compatibility facade refuses metadata writes before legacy methods run, and unsupported sources should also refuse metadata at their own write boundary.
|
|
472
499
|
|
|
500
|
+
## Optional issue links capability
|
|
501
|
+
|
|
502
|
+
An adapter opts in with `issueLinks: true` and must persist
|
|
503
|
+
`issueLinks?: IssueLink[]` (`{ issue: number, intent: 'closes' | 'refs' }`) on
|
|
504
|
+
create, update and revision-checked update, return them on every read sorted by
|
|
505
|
+
issue number (absent means none), treat an update's set as a complete replacement
|
|
506
|
+
where `[]` clears, and include nonempty links in revisions. `normalizeIssueLinks`
|
|
507
|
+
validates, defaults intent to `closes` and sorts. Without the flag, the
|
|
508
|
+
compatibility facade refuses any write naming links with
|
|
509
|
+
`TicketIssueLinksUnsupported` before your methods run, and strips links from reads.
|
|
510
|
+
|
|
511
|
+
## Optional priority capability
|
|
512
|
+
|
|
513
|
+
An adapter opts in with `priority: true` and must persist
|
|
514
|
+
`priority?: 'urgent' | 'normal'` on create, update and revision-checked update,
|
|
515
|
+
return `priority: 'urgent'` on every read of an urgent ticket and omit the field
|
|
516
|
+
otherwise, treat `normal` as clearing urgency, and include urgent priority in
|
|
517
|
+
revisions. The dispatcher claims urgent ready tickets before normal ones, each in
|
|
518
|
+
your listing order. Without the flag, every ticket reads as normal: the
|
|
519
|
+
compatibility facade refuses a write naming `urgent` with
|
|
520
|
+
`TicketPriorityUnsupported` before your methods run, drops a `normal` no-op
|
|
521
|
+
(skipping the call when nothing else remains), and strips priority from reads.
|
|
522
|
+
|
|
523
|
+
## Optional ready assignee capability
|
|
524
|
+
|
|
525
|
+
An adapter opts in to `[tickets].readyAssignee` with `readyAssignee: true` and
|
|
526
|
+
must then honour `criteria.assignee` in `listReady` (and `listPage`, if
|
|
527
|
+
implemented): only tickets assigned to that user are ready, and an unassigned
|
|
528
|
+
ticket is never ready while it is set. `"me"` means the owner of the source's
|
|
529
|
+
credential; any other value's forms are the source's to define and enforce.
|
|
530
|
+
Without the flag, dispatcher startup, `ab init --validate` and live reloads
|
|
531
|
+
refuse a configured `readyAssignee` with an error naming the source and plugin.
|
|
532
|
+
|
|
533
|
+
Three optional methods support it:
|
|
534
|
+
|
|
535
|
+
- `prepareReadyAssignee(): Promise<void>` is called once at dispatcher startup,
|
|
536
|
+
before the loop and never in a tick, whether or not `readyAssignee` is set.
|
|
537
|
+
Resolve whatever `"me"` needs and memoize it. A credential with no user is a
|
|
538
|
+
recorded result, not a throw; throw only for infrastructure failures, which
|
|
539
|
+
fail startup when `readyAssignee` is set and are otherwise a warning.
|
|
540
|
+
- `readyAssigneeRefusal(value): string | undefined` is synchronous and makes no
|
|
541
|
+
request. Return why the value can't be honoured from what was prepared, or
|
|
542
|
+
`undefined`. Startup and every reload call it, so a refused reload keeps the
|
|
543
|
+
previous configuration.
|
|
544
|
+
- `describeReadyAssignee(value): Promise<string>` serves `ab init --validate`:
|
|
545
|
+
return a one-line summary of who the value names, such as `me → @octocat`,
|
|
546
|
+
or throw an error that says how to fix a value that names nobody.
|
|
547
|
+
|
|
473
548
|
## Optional ticket paging capability
|
|
474
549
|
|
|
475
550
|
Native paging is an optional API 1.9 ticket-source capability:
|
|
@@ -484,10 +559,12 @@ match the exhaustive listing. The shared `describeTicketSourceContract` suite
|
|
|
484
559
|
automatically compares declared native paging with full-read windows.
|
|
485
560
|
|
|
486
561
|
Only paged operator listings select this capability. Sources without it retain
|
|
487
|
-
the full-read
|
|
562
|
+
the full-read fallback, which orders the listing before offset and limit: by
|
|
563
|
+
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
|
|
488
565
|
listings, CLI ticket lists and dispatcher ready scans remain exhaustive through
|
|
489
566
|
`listReady`/`listAll`. The hosted PostgreSQL source counts matches without
|
|
490
|
-
bodies and reads only the SQL-bounded window. File, Linear and the remote
|
|
567
|
+
bodies and reads only the SQL-bounded window. File, Linear, GitHub and the remote
|
|
491
568
|
`HostedTicketSource` retain fallback; the POST list-ready protocol stays exhaustive.
|
|
492
569
|
|
|
493
570
|
Hosted cooldown recording rejects observed reset deadlines beyond the 24-hour
|
|
@@ -372,7 +372,7 @@ it to exist. An unknown build returns `404 not-found`.
|
|
|
372
372
|
|
|
373
373
|
| BuildStore operation | HTTP route | Request | Success |
|
|
374
374
|
|---|---|---|---|
|
|
375
|
-
| `createBuild` | `POST /builds` | `{slug: string, repo: string, repoOrigin?: string, ticket?: TicketRef, branch?: string, created?: event write}`; `slug`, `repo`, and a supplied `branch` are nonempty. `created`, when present, must be a valid `build.created` write; the server appends it as seq 1 atomically with the record (both exist or neither), and an invalid one is `422` with nothing created | `201` + authoritative `BuildRecord`; project credentials receive a fresh random-suffixed slug and
|
|
375
|
+
| `createBuild` | `POST /builds` | `{slug: string, repo: string, repoOrigin?: string, ticket?: TicketRef, branch?: string, created?: event write}`; `slug`, `repo`, and a supplied `branch` are nonempty. `created`, when present, must be a valid `build.created` write; the server appends it as seq 1 atomically with the record (both exist or neither), and an invalid one is `422` with nothing created | `201` + authoritative `BuildRecord`; project credentials receive a fresh random-suffixed slug and a branch in the build kind's namespace (`ab/<slug>`, or `ab-node/<slug>` for a node); a supplied `branch` must be `ab/<requested slug>` or `ab-node/<requested slug>` agreeing with the `build.created` kind, otherwise `400 validation`. Owner admin/open mode keeps exact-slug semantics with `409 conflict` for duplicates |
|
|
376
376
|
| `listBuilds` | `GET /builds` | none | `200` + `BuildRecord[]`, filtered by the server to the credential project; owner admin may list all projects. List order is unspecified |
|
|
377
377
|
| `getBuild` | `GET /builds/{slug}` | none | `200` + `BuildRecord`; absent is `404` (the shipped client maps this to `null`) |
|
|
378
378
|
| `append` | `POST /builds/{slug}/events` | event write | `201` + build event envelope |
|
|
@@ -687,7 +687,7 @@ seconds (the stream/session wait ceiling) and 25 seconds. A held request's authe
|
|
|
687
687
|
are identical to the immediate form: a `401`, `403`, or `409` identity failure
|
|
688
688
|
is answered immediately, never held.
|
|
689
689
|
|
|
690
|
-
The parameter is purely additive in the version
|
|
690
|
+
The parameter is purely additive in the protocol version that introduced it (protocol `2`,
|
|
691
691
|
where the event-wait rules were introduced): a server
|
|
692
692
|
that ignores `wait` remains conforming — its immediate empty answers only raise
|
|
693
693
|
the client's request rate — and a client that sends `wait` to such a server
|
|
@@ -748,7 +748,8 @@ from one build's log:
|
|
|
748
748
|
"head": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
|
|
749
749
|
"base": "cccccccccccccccccccccccccccccccccccccccc",
|
|
750
750
|
"identities": ["build:child"]
|
|
751
|
-
}
|
|
751
|
+
},
|
|
752
|
+
"nodeTargets": ["ab-node-auth"] // node builds the build's target or parent moves ever named, sorted; [] when none
|
|
752
753
|
}
|
|
753
754
|
```
|
|
754
755
|
|
|
@@ -759,6 +760,16 @@ recording or recovering a contribution advances `readinessChangeSeq`. These
|
|
|
759
760
|
members are additive: older peers can omit them, leaving presence unproven rather
|
|
760
761
|
than substituting source completion. They do not change the protocol version.
|
|
761
762
|
|
|
763
|
+
`nodeTargets` lists every node build named by the build's `build.created`
|
|
764
|
+
target or by either side of a `node.parent-requested` or
|
|
765
|
+
`node.parent-accepted` move. The set only grows, so it is a superset of the
|
|
766
|
+
nodes the build relates to, and a dispatcher finds a node's child builds from
|
|
767
|
+
digests, reading full facts only for builds that name that node. Current
|
|
768
|
+
services always send it, possibly empty. The field is additive and keeps the
|
|
769
|
+
protocol version: older clients ignore it. A client that needs it and gets an
|
|
770
|
+
answer without it, from an older service, fails with a typed error instead of
|
|
771
|
+
reading each build's facts.
|
|
772
|
+
|
|
762
773
|
The digest is derived from the event log on every call — the server persists
|
|
763
774
|
nothing and there is no refresh step. Protocol version `3` reshaped the
|
|
764
775
|
digest's `observations` from bare sequence numbers to `{seq, ts}` pairs and
|
|
@@ -1110,7 +1121,7 @@ by this rule (their retention belongs to the open archival thread), and open
|
|
|
1110
1121
|
streams are never pruned. A read of a stream whose chunks were pruned returns
|
|
1111
1122
|
no chunks, `status: "closed"`, and the artifact reference.
|
|
1112
1123
|
|
|
1113
|
-
These additions were purely additive in the version
|
|
1124
|
+
These additions were purely additive in the protocol version that introduced them (protocol
|
|
1114
1125
|
`2`, where the stream routes were introduced), and a
|
|
1115
1126
|
conforming server implements the stream routes together with this document's
|
|
1116
1127
|
rules exactly as it does for the event and artifact routes.
|
|
@@ -1175,7 +1186,14 @@ streams must also belong to the addressed parent.
|
|
|
1175
1186
|
|
|
1176
1187
|
`GET /builds` is filtered by the server to the credential's project. Project
|
|
1177
1188
|
`POST /builds` always allocates a fresh random-suffixed slug from the requested
|
|
1178
|
-
base
|
|
1189
|
+
base, even when the base is unused, and a matching branch in the build kind's
|
|
1190
|
+
namespace: `ab-node/<slug>` when the `build.created` payload has `kind: "node"`,
|
|
1191
|
+
otherwise `ab/<slug>`. Without `created`, a supplied `branch` prefix decides the
|
|
1192
|
+
kind. A supplied `branch` must be exactly `ab/<requested slug>` or
|
|
1193
|
+
`ab-node/<requested slug>` and agree with the `build.created` kind; only its
|
|
1194
|
+
namespace is used. The base (the requested slug's first 60 characters, trailing
|
|
1195
|
+
hyphens removed) must be a kebab build slug. A malformed or conflicting branch,
|
|
1196
|
+
or an invalid base, is `400 validation` with nothing created. The
|
|
1179
1197
|
returned BuildRecord slug and branch are authoritative for all subsequent
|
|
1180
1198
|
work. A foreign or missing base returns null on GET; it neither reveals
|
|
1181
1199
|
collisions nor blocks creation. Owner admin retains exact-slug creation and
|
|
@@ -1252,8 +1270,8 @@ a guessed ID cannot bypass the boundary. Only the runner can heartbeat or re-acq
|
|
|
1252
1270
|
adopted repository lease holder; another current holder still fences it. Recovery acknowledgements remain dispatcher-side.
|
|
1253
1271
|
|
|
1254
1272
|
Hosted ticket access is gated by grant kind. Build-runner and build-phase grants
|
|
1255
|
-
cannot call ticket routes. Harvest-phase grants may call only list-ready,
|
|
1256
|
-
and dependency-states; harvest-runner grants may additionally create proposals.
|
|
1273
|
+
cannot call ticket routes. Harvest-phase grants may call only list-ready,
|
|
1274
|
+
list-targeting, get and dependency-states; harvest-runner grants may additionally create proposals.
|
|
1257
1275
|
Other ticket mutations require project or admin authority. A denied operation
|
|
1258
1276
|
returns 403 naming the grant kind and operation before parsing or source construction.
|
|
1259
1277
|
Ticket admission and repository-keyed assets use the authenticated project;
|
|
@@ -99,8 +99,9 @@ The strict request envelope is:
|
|
|
99
99
|
loads the project's durable independent ticket policy. Project authority publishes
|
|
100
100
|
version 1 policy through `POST /tickets/policy`, using the usual context/input
|
|
101
101
|
envelope. The input contains only `version` and `tickets`: source, teamKey,
|
|
102
|
-
readyState, triageState, claimedState, doneState, createState, proposalState
|
|
103
|
-
optional readyLabels
|
|
102
|
+
readyState, triageState, claimedState, doneState, createState, proposalState,
|
|
103
|
+
optional readyLabels, and the optional backlogState and rejectedState roles. URL,
|
|
104
|
+
secrets, and pipeline configuration are rejected.
|
|
104
105
|
Only project or owner authority can publish. This does not append BuildStore
|
|
105
106
|
history. Registration removal invalidates policy and grants from that registration.
|
|
106
107
|
|
|
@@ -114,6 +115,28 @@ State lookup prefers an exact match, then a unique case-insensitive match;
|
|
|
114
115
|
unknown or ambiguous names are refused. Lists order configured triage, ready,
|
|
115
116
|
doing, done first (deduplicated), then other names alphabetically.
|
|
116
117
|
|
|
118
|
+
`backlogState` and `rejectedState` have no defaults: an unset role holds no state,
|
|
119
|
+
and a policy that names neither behaves exactly as before. Each must differ,
|
|
120
|
+
case-insensitively, from the ready, claimed, done, triage and proposal states and
|
|
121
|
+
from the other; a publish that overlaps is refused with `400` naming the keys.
|
|
122
|
+
A named role's state is created when missing. Role names match existing states
|
|
123
|
+
case-insensitively, so `backlogState = "icebox"` next to an existing `icebox` (or
|
|
124
|
+
`Icebox`) state creates nothing: that state and its tickets now hold the role.
|
|
125
|
+
Removing a role leaves its state in place as a custom state. Operator and MCP
|
|
126
|
+
ticket tools resolve role moves through these policy names.
|
|
127
|
+
|
|
128
|
+
Clients that understand the roles send `x-autobuild-ticket-policy-roles: 1`. With
|
|
129
|
+
it, a publish is the complete policy, and omitting a role clears it. Without it,
|
|
130
|
+
as from released 1.2–1.4 clients, each omitted role keeps its saved value for the
|
|
131
|
+
same registration, so an older client never erases a newer client's mapping. If
|
|
132
|
+
a kept role would then name the same state as a lifecycle name that publish
|
|
133
|
+
sets, the service keeps the whole saved policy unchanged, answers
|
|
134
|
+
`200 { "ok": true }`, and records a diagnostic naming the colliding keys. A
|
|
135
|
+
policy read (`input: null`) includes the roles only with the header. Every
|
|
136
|
+
`/tickets/*` response, including errors, carries
|
|
137
|
+
`x-autobuild-ticket-policy-roles: 1`; a client publishing a role that receives
|
|
138
|
+
`400` without it reports that the service predates policy roles.
|
|
139
|
+
|
|
117
140
|
`[tickets] url` selects the ticket service independently of the build store;
|
|
118
141
|
otherwise the selected remote build store is used. A local build store requires
|
|
119
142
|
an explicit ticket URL. Credentials are resolved for that selected service.
|
|
@@ -129,10 +152,14 @@ AB_TOKEN. Revocation, expiry, parent revocation and registration changes invalid
|
|
|
129
152
|
grants. Existing combined-service BuildStore delegation remains supported.
|
|
130
153
|
|
|
131
154
|
The service never contacts Linear or relays external trackers. If the project's
|
|
132
|
-
source is Linear, file or another non-hosted source, machine HTTP, operator and
|
|
155
|
+
source is Linear, GitHub, file or another non-hosted source, machine HTTP, operator and
|
|
133
156
|
MCP ticket surfaces refuse with a message naming that project and source: its
|
|
134
157
|
tickets live in its own source, accessed directly by its dispatcher. This is a
|
|
135
158
|
409 conflict, not an empty queue. The dispatcher's direct adapters are unchanged.
|
|
159
|
+
Configuration refusals carry a `code`: `external-ticket-source` for a non-hosted
|
|
160
|
+
source, `no-dispatcher-run` when a project has neither a published ticket policy
|
|
161
|
+
nor any recorded dispatcher run, and `effective-config-unavailable` for other
|
|
162
|
+
missing or unreadable configuration.
|
|
136
163
|
|
|
137
164
|
## Operations
|
|
138
165
|
|
|
@@ -142,7 +169,9 @@ The operation names and `input` values are:
|
|
|
142
169
|
|---|---|---|
|
|
143
170
|
| `states` | `{}` | `{name, tickets, about?}[]`, including empty states |
|
|
144
171
|
| `add-state` | `{name, about?: string}` | `{state: {name,tickets,about?}, created: boolean}` |
|
|
172
|
+
| `state-counts` | `{names: string[]}` (1–16) | `{name, tickets}[]` for the names that resolve |
|
|
145
173
|
| `list-ready` | `{labels?: string[], state?: string}` | `TicketListing` |
|
|
174
|
+
| `list-targeting` | `{nodeId: string}` | `TicketListing` of every state |
|
|
146
175
|
| `get` | `{id}` | `Ticket \| null` |
|
|
147
176
|
| `claim` | `{id}` | `{claimed: boolean}` |
|
|
148
177
|
| `comment` | `{id, body}` | `{ok: true}` |
|
|
@@ -207,8 +236,8 @@ current required resolution fields; domain and storage types are unchanged.
|
|
|
207
236
|
Build and harvest runners exchange project authority for signed, project-bound
|
|
208
237
|
execution and phase credentials through `/credentials/delegate` (see the remote
|
|
209
238
|
store protocol). Build-runner and build-phase credentials cannot call any ticket
|
|
210
|
-
operation. Harvest-phase credentials permit only list-ready, get
|
|
211
|
-
dependency-states. Harvest-runner credentials permit those reads plus create
|
|
239
|
+
operation. Harvest-phase credentials permit only list-ready, list-targeting, get
|
|
240
|
+
and dependency-states. Harvest-runner credentials permit those reads plus create
|
|
212
241
|
for filing proposals. Claim, comment, transition, update, add-blocker and
|
|
213
242
|
remove-blocker require project or admin authority; their access is unchanged.
|
|
214
243
|
Denied delegated calls return 403 with an error naming the grant kind and
|
|
@@ -222,6 +251,10 @@ Custom state creation uses `/^[a-z][a-z0-9-]{0,39}$/`; an optional purpose must
|
|
|
222
251
|
be one nonblank line. A duplicate in any letter case is refused without
|
|
223
252
|
changing purpose. `add-state` requires project or owner machine authority;
|
|
224
253
|
ticket grants and harvest delegations can read states but cannot create them.
|
|
254
|
+
`state-counts` returns bounded per-state totals only, never ticket rows, with
|
|
255
|
+
each name resolved exactly or by one case-insensitive match. It requires project
|
|
256
|
+
or owner authority, not ticket grants or harvest delegations. A source without
|
|
257
|
+
state counts answers 409 conflict, with no listing fallback.
|
|
225
258
|
Request context cannot supply lifecycle policy or insert another project's
|
|
226
259
|
states. These operations use the existing wire version and strict envelopes.
|
|
227
260
|
|
|
@@ -232,13 +265,15 @@ Every ticket read includes an opaque `revision`. Pass it as `expectedRevision`
|
|
|
232
265
|
`move`, `block` and `unblock`. A stale write fails without changing anything and
|
|
233
266
|
reports the current revision. Omission preserves unguarded behavior. Blocker
|
|
234
267
|
checks cover the entire batch. Dispatcher moves remain unguarded and change the
|
|
235
|
-
revision. Sources without guarded writes, including Linear, refuse
|
|
236
|
-
revisions rather than ignoring them.
|
|
268
|
+
revision. Sources without guarded writes, including Linear and GitHub, refuse
|
|
269
|
+
supplied revisions rather than ignoring them.
|
|
237
270
|
|
|
238
271
|
`ab ticket edit <id>` opens `$VISUAL`, falling back to `$EDITOR`, using TOML
|
|
239
272
|
frontmatter and a Markdown body. Only title, body and labels are editable;
|
|
240
273
|
id, blockers, creation key and reference comments are read-only. It saves only
|
|
241
|
-
changed fields with the opening revision.
|
|
274
|
+
changed fields with the opening revision. Sources without guarded writes,
|
|
275
|
+
including Linear and GitHub, re-read the ticket immediately before an
|
|
276
|
+
unguarded write and refuse a changed revision, with the no-lock race window of file checks. Unchanged or formatting-only edits
|
|
242
277
|
write nothing. On conflict, invalid input or editor failure, the error names an
|
|
243
278
|
absolute file path containing the edited text. Read the current ticket and
|
|
244
279
|
reapply the intended changes before retrying; conflicts are never merged.
|
|
@@ -258,7 +293,8 @@ snapshot of fields, blockers and revision.
|
|
|
258
293
|
|
|
259
294
|
`POST /tickets/mutate-if-revision` accepts the usual authenticated context and
|
|
260
295
|
`input: { id, expectedRevision, mutation }`. Mutation is one of
|
|
261
|
-
`{ kind: "update", patch: { title?, body?, labels?, kind?, target
|
|
296
|
+
`{ kind: "update", patch: { title?, body?, labels?, kind?, target?,
|
|
297
|
+
priority?: "urgent" | "normal" } }`,
|
|
262
298
|
`{ kind: "transition", state }`, or
|
|
263
299
|
`{ kind: "blockers", operation: "block" | "unblock", ids: string[] }`.
|
|
264
300
|
Unknown keys and empty patches are refused. Success returns `{ ok: true }`.
|
|
@@ -280,8 +316,11 @@ BuildStore protocol version.
|
|
|
280
316
|
|
|
281
317
|
Create options accept optional `requestedId: string` alongside `state` and
|
|
282
318
|
`idempotencyKey`. Older clients omit it and responses are unchanged. Unsupported
|
|
283
|
-
sources reject supplied ids
|
|
284
|
-
|
|
319
|
+
sources reject supplied ids. Linear is not an import target. GitHub rejects
|
|
320
|
+
supplied ids but is an import target: it allocates every issue number itself and
|
|
321
|
+
import remaps each ticket to the number GitHub returns, as described in the
|
|
322
|
+
migration procedure's GitHub section. File sources keep filesystem-safe ids
|
|
323
|
+
exactly and never overwrite an occupied id.
|
|
285
324
|
|
|
286
325
|
Hosted sources preserve only literal own-team `<teamKey>-<n>` ids, where `n` is a
|
|
287
326
|
positive canonical decimal within PostgreSQL bigint bounds. For example,
|
|
@@ -312,11 +351,86 @@ Effective metadata changes increment the revision; equivalent aliases are no-ops
|
|
|
312
351
|
Ticket responses include these fields only with `x-autobuild-ticket-tree: 1`.
|
|
313
352
|
This capability is independent of revision and comment capabilities and of the
|
|
314
353
|
client version. Without it, both fields are projected away, preserving historical
|
|
315
|
-
strict decoders. Current hosted clients send
|
|
354
|
+
strict decoders. Current hosted clients send every capability header and
|
|
316
355
|
default absent kind to `work`. Unfiltered listing includes all ticket states and
|
|
317
356
|
empty nodes for `ab ticket tree`; dispatch and merge behavior are unchanged.
|
|
318
357
|
|
|
358
|
+
### Targeted listing
|
|
359
|
+
|
|
360
|
+
`list-targeting` returns every ticket in every state whose `target` is exactly
|
|
361
|
+
`nodeId`, equal to unfiltered `list-ready` filtered by target, read through the
|
|
362
|
+
project's target index so its cost follows the node's children rather than the
|
|
363
|
+
project's ticket count. An unknown id returns an empty listing. A backing source
|
|
364
|
+
without targeted listing answers `409` with `code: "targeting-unsupported"`; the
|
|
365
|
+
service never filters a full listing instead. Ticket grants and harvest
|
|
366
|
+
delegations may call it wherever they may call `list-ready`.
|
|
367
|
+
|
|
368
|
+
Every `/tickets/*` response, including errors, carries
|
|
369
|
+
`x-autobuild-ticket-targeting: 1`. A current client declares `listTargeting`
|
|
370
|
+
only after a response from the service has carried that header, and settles the
|
|
371
|
+
decision before use: from the policy sync, or else from one `list-targeting`
|
|
372
|
+
probe for the reserved id `~negotiate`, which never names a ticket. An ok
|
|
373
|
+
response without the header, or a `404` or `400` refusal of `list-targeting`
|
|
374
|
+
without it, means the service predates the operation. Against such a service
|
|
375
|
+
the client never declares it, and integration observation uses the exhaustive
|
|
376
|
+
listing by that explicit decision. An inconclusive probe (a network failure or
|
|
377
|
+
an unmarked gateway error) fails source construction. A targeted read the
|
|
378
|
+
service later refuses fails closed, with no fallback within the pass.
|
|
379
|
+
|
|
380
|
+
## Issue links
|
|
381
|
+
|
|
382
|
+
Hosted tickets store forge issue links as `issueLinks`, an array of
|
|
383
|
+
`{ "issue": N, "intent": "closes" | "refs" }` with unique positive issue numbers.
|
|
384
|
+
Create, update and guarded update accept the field; intent is required on the
|
|
385
|
+
wire. Update replaces the whole set and `[]` clears it. The service stores links
|
|
386
|
+
sorted by issue number. Effective changes increment the revision, and rewriting
|
|
387
|
+
an identical set is a no-op.
|
|
388
|
+
|
|
389
|
+
Ticket responses include nonempty `issueLinks` only with
|
|
390
|
+
`x-autobuild-ticket-issue-links: 1`, independently of the other capabilities and
|
|
391
|
+
of the client version. Without it, links are projected away for historical strict
|
|
392
|
+
decoders, and stored links survive their writes. Every `/tickets/*` response,
|
|
393
|
+
including errors, carries `x-autobuild-ticket-issue-links: 1`.
|
|
394
|
+
|
|
395
|
+
`dependency-states` entries for existing tickets include `state`, the blocker's
|
|
396
|
+
native state name, only with `x-autobuild-ticket-dependency-state: 1`. Without
|
|
397
|
+
it the field is projected away for historical strict decoders. A service that
|
|
398
|
+
predates the capability ignores the header and omits the field, which is
|
|
399
|
+
optional. Clients apply the configured rejected role to it; the service never
|
|
400
|
+
interprets it.
|
|
401
|
+
|
|
402
|
+
A service whose backing source cannot store links refuses a write naming them,
|
|
403
|
+
including `[]`, with `409 { "kind": "conflict", "code": "issue-links-unsupported" }`
|
|
404
|
+
before anything is written. A service predating issue links refuses the unknown
|
|
405
|
+
field with a `400` validation error and no capability header. Clients report both
|
|
406
|
+
as `TicketIssueLinksUnsupported`.
|
|
407
|
+
|
|
319
408
|
Completed ticket imports record `tickets.migration-recorded` in the selected
|
|
320
409
|
BuildStore repository journal, with export identity, origin/destination adapter
|
|
321
410
|
names and the actual complete ID mapping. Requested-ID preservation alone does
|
|
322
411
|
not establish continuity for in-flight builds; see the migration procedure.
|
|
412
|
+
|
|
413
|
+
## Priority
|
|
414
|
+
|
|
415
|
+
Hosted tickets store `priority`, either `"urgent"` or `"normal"`. Create,
|
|
416
|
+
update and guarded update accept it as an optional field. A create that omits it
|
|
417
|
+
files a normal ticket, and an update that omits it never changes it. Tickets that
|
|
418
|
+
existed before the field read as normal. A priority change increments the
|
|
419
|
+
revision, and rewriting the same value is a no-op.
|
|
420
|
+
|
|
421
|
+
Ticket responses include `priority` on every ticket, `normal` included, only with
|
|
422
|
+
`x-autobuild-ticket-priority: 1`, independently of the other capabilities and of
|
|
423
|
+
the client version. Without it, priority is projected away for historical strict
|
|
424
|
+
decoders, whose writes never name it and so never clear it. Every `/tickets/*`
|
|
425
|
+
response, including errors, carries `x-autobuild-ticket-priority: 1`.
|
|
426
|
+
|
|
427
|
+
`list-ready` returns urgent tickets first, then normal ones, each class in filing
|
|
428
|
+
order, for every client. Ordering happens within the existing listing; it adds no
|
|
429
|
+
per-ticket reads.
|
|
430
|
+
|
|
431
|
+
A service whose backing source cannot store priority refuses a write naming
|
|
432
|
+
`urgent` with `409 { "kind": "conflict", "code": "priority-unsupported" }` before
|
|
433
|
+
anything is written. A service predating priority refuses the unknown field with a
|
|
434
|
+
`400` validation error and no capability header. Clients report both as
|
|
435
|
+
`TicketPriorityUnsupported`. Current clients omit `normal` on create, so a plain
|
|
436
|
+
create still works against such a service.
|
package/docs/restacking.md
CHANGED
|
@@ -84,8 +84,11 @@ pending while ancestors restack or reconcile. A durable availability observation
|
|
|
84
84
|
allows unchanged idle ticks, including after restart, to skip repository preparation
|
|
85
85
|
and native auto-merge cancellation. Exact node/parent heads, contribution base,
|
|
86
86
|
request contents, accepted ancestry, foreign aliases and confirmed landing evidence
|
|
87
|
-
invalidate that observation when they change; polling timestamps do not.
|
|
88
|
-
|
|
87
|
+
invalidate that observation when they change; polling timestamps do not. Confirmed
|
|
88
|
+
landing evidence comes from every repository build, including mixed-version deferred
|
|
89
|
+
builds whose own decisions stay withheld, so the dispatcher check and the node
|
|
90
|
+
transaction assess the same fingerprint. Failed assessments never establish
|
|
91
|
+
unavailability. Availability is not proof of destination
|
|
89
92
|
coverage. Moving to another destination branch explicitly settles obsolete requests
|
|
90
93
|
with `destination-changed`; losing identities on the same branch leaves them waiting.
|
|
91
94
|
Native auto-merge is suspended with confirmed, reusable receipts only when replay
|
|
@@ -126,8 +129,10 @@ Before replacement the kernel publishes retained tips, displaced heads and the
|
|
|
126
129
|
temporary change under immutable exact archive refs. Remote archives also publish
|
|
127
130
|
commits present only on the remote: GitHub uses create-only Git-reference REST creation
|
|
128
131
|
when the workspace lacks the commit, retaining guarded Git pushes for local objects.
|
|
129
|
-
Exact remote readback confirms publication, then a
|
|
130
|
-
(without tags
|
|
132
|
+
Exact remote readback confirms publication, then a non-shallow fetch of only that exact
|
|
133
|
+
archive ref (without tags, configured refmap expansion or a depth limit) restores
|
|
134
|
+
missing commits and their missing ancestry, writes no shallow boundary, leaves an
|
|
135
|
+
already-shallow repository's existing boundaries unchanged, and verifies the commits
|
|
131
136
|
locally before returning. `restack.*` facts record
|
|
132
137
|
preparation, replay, intent, archived replacement, contention and completion.
|
|
133
138
|
Unpublished request/loss records alone cannot preserve objects from a released
|
|
@@ -221,7 +226,11 @@ retry allowance. Rejected pushes, lease conflicts, dirty trees and unclassified
|
|
|
221
226
|
errors retain their existing behavior.
|
|
222
227
|
|
|
223
228
|
Preserved restoration checkpoints survive repeated replacement; a published
|
|
224
|
-
reconcile or restack rewrite retires the old checkpoint.
|
|
229
|
+
reconcile or restack rewrite retires the old checkpoint. Node, restack and
|
|
230
|
+
reconcile rewrites also supersede a branch checkpoint that the build's bounded
|
|
231
|
+
record of its latest 64 replaced heads covers: provisioning keeps its archived
|
|
232
|
+
objects but never restores it over the branch. Coverage older than that bound
|
|
233
|
+
falls back to refusing divergent branch work.
|
|
225
234
|
Recovery context applies to the following session and its repeated hydration; later
|
|
226
235
|
sessions do not inherit obsolete reconstruction instructions.
|
|
227
236
|
|
|
@@ -244,7 +253,12 @@ external ticket state, missing ticket/state, or conflicting slug ownership termi
|
|
|
244
253
|
automatic recovery with an `abandoned` resolution and diagnostic reason. The
|
|
245
254
|
ticket is left unchanged; an operator can leave it finished or cancelled, or
|
|
246
255
|
inspect ownership and explicitly return it to Ready for another attempt. These
|
|
247
|
-
cases stop provider polling and diagnostic appends.
|
|
256
|
+
cases stop provider polling and further durable diagnostic appends. The tick
|
|
257
|
+
that records the abandonment reports one dispatcher diagnostic naming the
|
|
258
|
+
ticket and attempt, whether the claim was confirmed or its provider outcome is
|
|
259
|
+
unknown, and the recorded reason. If that tick fails for any reason, its
|
|
260
|
+
failure error carries the diagnostics instead. Later ticks do not repeat it.
|
|
261
|
+
Recovery failures are
|
|
248
262
|
reported without preventing janitor, lease sweep, or other dispatch recovery.
|
|
249
263
|
This is not general process
|
|
250
264
|
crash recovery. Confirmed Ready/Triage transitions settle idempotently, so a
|
package/docs/seams.md
CHANGED
|
@@ -14,7 +14,7 @@ Adapters supply storage, agent execution, code publication, workspaces and ticke
|
|
|
14
14
|
## Storage and tickets
|
|
15
15
|
|
|
16
16
|
- **BuildStore.** Local SQLite with filesystem artifacts by default; a remote store implementing the remote BuildStore protocol.
|
|
17
|
-
- **Tickets.** Local files, Linear, or
|
|
17
|
+
- **Tickets.** Local files, Linear, hosted tickets, or GitHub issues. A hosted Store doesn't require hosted tickets.
|
|
18
18
|
|
|
19
19
|
See [Build store](build-store.md) and [Tickets](ticket-sources.md).
|
|
20
20
|
|
|
@@ -56,7 +56,7 @@ See [Dispatcher hosting](dispatcher-hosting.md).
|
|
|
56
56
|
|
|
57
57
|
## Seam guides
|
|
58
58
|
|
|
59
|
-
- [Tickets](ticket-sources.md): file, Linear, hosted, ticket trees.
|
|
59
|
+
- [Tickets](ticket-sources.md): file, Linear, hosted, GitHub, ticket trees.
|
|
60
60
|
- [Agent runtimes](agent-runtimes.md): Claude Code, Codex, Pi, models.
|
|
61
61
|
- [Workspaces](workspaces.md): git worktree, Vercel Sandbox, provisioning.
|
|
62
62
|
- [Forges](forges.md): GitHub, local git, publication adapters.
|
package/docs/setup.md
CHANGED
|
@@ -126,7 +126,9 @@ exits nonzero on failure. Then:
|
|
|
126
126
|
alternate. The runtime that launched setup and the temporary fresh-skeleton
|
|
127
127
|
default do not constrain the final arrangement.
|
|
128
128
|
3. Choose the ticket source and workflow states. Confirm account/team facts and
|
|
129
|
-
required environment credentials.
|
|
129
|
+
required environment credentials. The `github` source needs no new secret:
|
|
130
|
+
it uses the forge's `GITHUB_TOKEN`, `GH_TOKEN` or `gh auth login`, which must
|
|
131
|
+
read and write the repository's issues. Author a repository-owned acceptance-check skill and select it from an agent
|
|
130
132
|
verify step in every repository. An **acceptance check** is a repository-owned agent verify step that runs the built software, exercises each acceptance criterion in the spec, attaches evidence, and returns a typed verdict. Every repository must configure one. It is not a test suite and leaves no test files behind.
|
|
131
133
|
Wire an existing maintained end-to-end or browser test suite into an ordinary `check` step. If none exists, do not create one during setup. The acceptance check neither substitutes for nor seeds a suite.
|
|
132
134
|
4. Preserve an existing `autobuild.toml` and unrelated repository choices on a
|
|
@@ -391,14 +393,10 @@ manifest-directed artifact paths remain authoritative. Never commit scratch.
|
|
|
391
393
|
1. Run `ab context` and read `"$AB_CONTEXT_DIR/context.json"`. The verifier receives
|
|
392
394
|
`$AB_CONTEXT_DIR/spec.md`, the configured step,
|
|
393
395
|
the commit range, and, after escalation is answered, `$AB_CONTEXT_DIR/guidance.json`.
|
|
394
|
-
Node verify sessions also receive `nodeVerification
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
and index. These hand-pushed node commit messages express maintainer-authorized
|
|
399
|
-
intent; judge quality and consistency, and never fail them solely for lacking
|
|
400
|
-
a covering spec. Other node changes are authorized when the node spec or the introducing
|
|
401
|
-
contribution's spec covers it; use the commit index to find that spec.
|
|
396
|
+
Node verify sessions also receive `nodeVerification`: contribution specs,
|
|
397
|
+
a commit provenance index and owned `handPushedCommits`, read through the
|
|
398
|
+
manifest's allocated paths. Judge them as described in
|
|
399
|
+
[node verification context](integration-tree.md#node-verification-context).
|
|
402
400
|
2. Exercise each applicable acceptance criterion through the repository's real
|
|
403
401
|
application lifecycle. Prefer the narrowest honest flow that catches a
|
|
404
402
|
regression.
|
|
@@ -434,7 +432,7 @@ Owner admin requests require an explicit registered context.repo; project creden
|
|
|
434
432
|
cannot select another project. See [local builds with hosted tickets](#local-builds-with-hosted-tickets).
|
|
435
433
|
|
|
436
434
|
The service never contacts Linear. Projects with external sources (including
|
|
437
|
-
file and
|
|
435
|
+
file, Linear and GitHub) keep using those sources directly through their dispatcher;
|
|
438
436
|
service ticket HTTP and operator surfaces refuse with project/source
|
|
439
437
|
feedback rather than returning an empty queue.
|
|
440
438
|
|
|
@@ -463,6 +461,9 @@ To retain earlier names configure `triageState = "Backlog"`,
|
|
|
463
461
|
`claimedState = "Doing"`, `doneState = "Done"`, and the desired `readyState`.
|
|
464
462
|
Existing ticket rows are never renamed. Older combined-service clients continue
|
|
465
463
|
using the uploaded dispatcher configuration until independent policy is published.
|
|
464
|
+
Also set the recommended `backlogState` and `rejectedState` so agents can defer
|
|
465
|
+
and decline work by role; role moves create a missing state on first use.
|
|
466
|
+
Published policy carries both roles, and publishes from older clients keep them.
|
|
466
467
|
|
|
467
468
|
## Forge readiness
|
|
468
469
|
|
|
@@ -522,9 +523,11 @@ with hosted ticket numbering reset to 1. See
|
|
|
522
523
|
## Hosted dispatch and local viewing
|
|
523
524
|
|
|
524
525
|
A plain `ab dispatch` reads dispatch placement once before starting local execution.
|
|
525
|
-
For a hosted project it opens the
|
|
526
|
+
For a hosted project it opens the viewer automatically, displaying
|
|
526
527
|
`viewer · dispatched by <host>` from the placement origin (including a nondefault
|
|
527
528
|
port). `--once`, `--plain`, and `--interval` retain their viewer meanings.
|
|
529
|
+
The viewer reads its dashboard from the Store; its one ticket-source read is
|
|
530
|
+
the header's triage count, through the source's optional `countStates`.
|
|
528
531
|
`--takeover` explicitly dispatches locally, with a warning that it can displace
|
|
529
532
|
the hosted dispatcher; it cannot be combined with `--viewer`. Startup intake
|
|
530
533
|
flags require `--takeover` when placement selects viewer.
|
|
@@ -533,6 +536,9 @@ An unreadable placement fails closed with a typed error naming the cause:
|
|
|
533
536
|
use `--viewer` to watch or `--takeover` to dispatch locally. Both explicit modes
|
|
534
537
|
skip placement discovery. Older services without the capability and projects
|
|
535
538
|
with unknown or nonhosted placement retain local dispatch behavior. Local stores
|
|
536
|
-
need no placement request.
|
|
537
|
-
|
|
539
|
+
need no placement request. Failing to resolve the checkout's store selection
|
|
540
|
+
(for example, a malformed `autobuild.toml`) is not a placement failure: default
|
|
541
|
+
startup reports it as a repository resolution error naming its cause, and
|
|
542
|
+
neither explicit mode bypasses it. Origin mode (`--repository` or
|
|
543
|
+
`AB_REPOSITORY`) and hosted cron dispatch bypass this check. Placement is a startup snapshot, not a
|
|
538
544
|
liveness probe or a polling input.
|
package/docs/spec-standard.md
CHANGED
|
@@ -164,7 +164,8 @@ order.
|
|
|
164
164
|
The spec is the build's contract artifact (kind `spec`, revision 0).
|
|
165
165
|
Every downstream reviewer approves conformance to its pinned revision.
|
|
166
166
|
For leaves, a phase that discovers the spec itself is wrong raises an
|
|
167
|
-
escalation (`ab escalate`);
|
|
167
|
+
escalation (`ab escalate`); your operator agent, within your instructions and
|
|
168
|
+
authority, or you answer it with a revised spec. The spec gets revision N+1,
|
|
168
169
|
and the leaf restarts from `plan` after any unfinished reconcile resumes under
|
|
169
170
|
the revised spec and its publication is confirmed.
|
|
170
171
|
|