@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
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
`ab ticket create --blocked-by` validates prerequisite ids and records blocking
|
|
4
4
|
relationships, but a single CLI command is **not an atomic publication guarantee**.
|
|
5
|
-
In particular, direct Linear
|
|
5
|
+
In particular, direct Linear and GitHub create the issue first and add
|
|
6
6
|
its blocker relationships in separate requests. If the issue is already in the
|
|
7
7
|
ready state, a dispatcher can see it before those relationships exist. A
|
|
8
8
|
successful create response containing every blocker does not prove that no build
|
|
@@ -19,6 +19,8 @@ before publishing it. Use the repository's triage state when it differs from its
|
|
|
19
19
|
ready state. This temporary staging does not require another placement approval.
|
|
20
20
|
If no non-ready state can be established, resolve that before creating the
|
|
21
21
|
dependent; never guess that a name such as "Backlog" is safe in every repository.
|
|
22
|
+
A configured backlog role is a known non-ready state: `ab ticket move <id>
|
|
23
|
+
--role backlog` reaches it without knowing its native name.
|
|
22
24
|
|
|
23
25
|
1. Create prerequisites in dependency order and extract each new `.ref.id` from
|
|
24
26
|
the complete `--json` response, never the human confirmation line.
|
|
@@ -28,7 +30,12 @@ dependent; never guess that a name such as "Backlog" is safe in every repository
|
|
|
28
30
|
non-ready and every expected blocker is present. Repair missing relationships
|
|
29
31
|
through `ab ticket block`, then read back again.
|
|
30
32
|
4. Only after verification, move it to the intended final state with
|
|
31
|
-
`ab ticket move <id> <state> --json
|
|
33
|
+
`ab ticket move <id> <state> --json`, or by role with
|
|
34
|
+
`ab ticket move <id> --role ready --json`. Verify the final state and blockers.
|
|
35
|
+
|
|
36
|
+
A blocker in the configured rejected state never resolves: its dependents stay
|
|
37
|
+
unclaimed until the blocker leaves that state or is removed with
|
|
38
|
+
`ab ticket unblock`.
|
|
32
39
|
|
|
33
40
|
For a repository whose configured triage and ready states are `Triage` and
|
|
34
41
|
`Ready`, respectively, and whose human requested ready placement:
|
|
@@ -77,13 +84,24 @@ parent history. An empty completed contribution is satisfied; missing evidence,
|
|
|
77
84
|
an open or aborted node, or ambiguous newest build generations remain queued.
|
|
78
85
|
Older successful generations are never substituted for the newest build.
|
|
79
86
|
|
|
80
|
-
Destination observations
|
|
81
|
-
commit SHAs and direct build trailers
|
|
87
|
+
Destination observations record a head-bound, query-scoped probe rather than
|
|
88
|
+
the destination's history: only the commit SHAs and direct build trailers in the
|
|
89
|
+
proof closure of the identities being decided (blocker identities, plus the
|
|
90
|
+
landings and confirmed foreign aliases that could transport them), which of those
|
|
91
|
+
are reachable from the sampled head, presence answers for only those identities,
|
|
92
|
+
and a fixed-length evidence digest. Observation size is bounded by that closure,
|
|
93
|
+
independent of the destination's reachable commit count and of repository history.
|
|
94
|
+
While the head is unchanged and the probe covers the current questions, current
|
|
82
95
|
confirmed landings and aliases from only the destination's accepted ancestry are
|
|
83
|
-
reapplied
|
|
84
|
-
invalidate
|
|
85
|
-
|
|
86
|
-
|
|
96
|
+
reapplied without Git; unrelated merged history and ready-set changes neither
|
|
97
|
+
invalidate it nor append events. A moved head requires a fresh Git sample. A
|
|
98
|
+
newly relevant landing or a new question needs only a new probe: a dispatcher
|
|
99
|
+
still holding the full in-memory witness for that branch and head compacts one
|
|
100
|
+
without Git, and otherwise samples Git once. Observations without a probe,
|
|
101
|
+
including older full-history witnesses, are never trusted for admission: they
|
|
102
|
+
are re-derived once the same way, and an unavailable sample leaves the dependent
|
|
103
|
+
queued; neither replays repository history. Current readiness and
|
|
104
|
+
newest-generation checks still apply before claim.
|
|
87
105
|
|
|
88
106
|
- Same node: the blocking change merges directly into the target.
|
|
89
107
|
- Ancestor: the change merges into an ancestor, then presence demand restacks only the required path to the target.
|
package/docs/ticket-migration.md
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Export and import use the ordinary file ticket layout. They operate on tickets
|
|
4
4
|
and current attachments through the ticket source; neither command contacts the
|
|
5
|
-
forge
|
|
5
|
+
forge, except that a GitHub source reads and writes the repository's issues.
|
|
6
|
+
File, hosted and GitHub sources support import. Every built-in source supports
|
|
7
|
+
export.
|
|
6
8
|
|
|
7
9
|
1. Pause intake and quiesce build-related ticket writes and other ticket writers
|
|
8
10
|
for the cutover. In-flight builds need not be aborted. Import preflight does
|
|
@@ -13,8 +15,8 @@ forge. File and hosted sources support import. Linear supports export only.
|
|
|
13
15
|
directory only after all reads succeed. Back up the target tracker too.
|
|
14
16
|
3. Configure the new `[tickets]` source, or use `ab connect --tickets URL` for a
|
|
15
17
|
hosted ticket service. Keep the export directory intact.
|
|
16
|
-
4. Run `ab ticket import /path/to/export`. Inspect its
|
|
17
|
-
mappings and `/path/to/export/.ab-import-map.json`.
|
|
18
|
+
4. Run `ab ticket import /path/to/export [--states <state,…>]`. Inspect its
|
|
19
|
+
printed ticket and state mappings and `/path/to/export/.ab-import-map.json`.
|
|
18
20
|
5. Import records a durable source/ID mapping in the same BuildStore and repository
|
|
19
21
|
that hold the existing builds, after tickets, metadata and assets finish.
|
|
20
22
|
Keep that BuildStore/repository identity through the cutover.
|
|
@@ -37,13 +39,40 @@ through export when file or Linear tickets have attachments there.
|
|
|
37
39
|
State directory names use lowercase letters, digits and hyphens, start with a
|
|
38
40
|
letter and contain at most forty characters. Export maps `In Progress` to
|
|
39
41
|
`in-progress`, `Backlog` to `backlog`, and `Done` to `done`. It retains each ticket's
|
|
40
|
-
state
|
|
42
|
+
state, and the manifest records which lifecycle roles each state held under the
|
|
43
|
+
exporting configuration: triage, ready, claimed, done, backlog, rejected, and the
|
|
44
|
+
create and proposal placements. Distinct names that collapse to the
|
|
41
45
|
same directory fail before publication. The hidden `.ab-migration.json` records
|
|
42
46
|
original display names and the state map. Import also accepts ordinary legacy
|
|
43
47
|
file layouts: it reuses exact or unique case-insensitive target states before
|
|
44
48
|
normalizing new names. A seeded `done` satisfies `Done`; absent `In Progress`
|
|
45
49
|
creates `in-progress`. Ambiguous matches and colliding state maps fail preflight.
|
|
46
50
|
|
|
51
|
+
A state that held a role lands in the destination's state for the same role,
|
|
52
|
+
whatever either source calls it. For example, an `icebox` backlog lands in a
|
|
53
|
+
`later` backlog, and Linear's `Backlog` triage lands in `triage`. A state holding
|
|
54
|
+
several roles takes the first of done, rejected, claimed, ready, backlog, triage,
|
|
55
|
+
proposal and create. If the destination configures no backlog or rejected state
|
|
56
|
+
for such a state, import refuses and names the `[tickets]` key to set. States
|
|
57
|
+
without a role, and exports made before roles were recorded, map by name as above.
|
|
58
|
+
|
|
59
|
+
## Importing selected states
|
|
60
|
+
|
|
61
|
+
`ab ticket import <dir> --states triage,ready,icebox` imports only the tickets in
|
|
62
|
+
the named states and creates only those states. Teams moving to a new tracker
|
|
63
|
+
often take their open work and leave closed history behind. A name matches an
|
|
64
|
+
export directory exactly, then by unique case-insensitive match, then by the
|
|
65
|
+
original display name the manifest recorded (`In Progress` for `in-progress`).
|
|
66
|
+
An unknown name is refused, and the refusal lists the export's states.
|
|
67
|
+
|
|
68
|
+
A blocker on a left-out ticket in the done role is dropped as resolved. Any other
|
|
69
|
+
reference to a left-out ticket is reported before any write, and nothing is
|
|
70
|
+
imported. That covers a blocker in another state, an integration-tree target, and
|
|
71
|
+
an issue link to a left-out issue in an export from GitHub. Import also refuses a
|
|
72
|
+
selection that leaves out a ticket an unfinished build is working on or targets.
|
|
73
|
+
The refusal names the build and the ticket, so in-flight work keeps its continuity.
|
|
74
|
+
Without `--states`, every ticket is imported.
|
|
75
|
+
|
|
47
76
|
File targets retain source ids. Hosted targets keep canonical own-team ids:
|
|
48
77
|
`AUT-706` imported into team `AUT` stays `AUT-706`. Other ids receive numbers above
|
|
49
78
|
all existing and preserved incoming numbers. Known clashes with unrelated tickets
|
|
@@ -52,7 +81,8 @@ Content similarity and stale mapping files never establish identity.
|
|
|
52
81
|
|
|
53
82
|
Creation keys establish identity. Exports retain existing keys and assign keys to
|
|
54
83
|
legacy tickets. Importing an ordinary file layout first saves a hidden migration
|
|
55
|
-
identity and keys in that input directory.
|
|
84
|
+
identity and keys in that input directory. The identity also records when it was
|
|
85
|
+
first saved, and that time is passed as the creation keys' reservation time. Preserve this file and the input across
|
|
56
86
|
retries. After interruption, rerun the same command: committed creates are adopted
|
|
57
87
|
by key even if their mapping write failed. Adopted bodies and other fields are not
|
|
58
88
|
overwritten. Missing blockers and comments are replayed, and unchanged attachments
|
|
@@ -62,7 +92,7 @@ timestamps remain in the export; imported comments use the target's metadata.
|
|
|
62
92
|
|
|
63
93
|
Portable records use TOML frontmatter between `+++` fences and an unchanged
|
|
64
94
|
Markdown body. Alongside `id`, `title`, `labels`, `blockedBy` and `idempotencyKey`,
|
|
65
|
-
optional `comments` contain `body`, `createdAt` and optional `author`. Optional
|
|
95
|
+
optional `issueLinks` contain `issue` and `intent` (`closes` or `refs`), optional `priority` is `"urgent"` (absent means normal), optional `comments` contain `body`, `createdAt` and optional `author`. Optional
|
|
66
96
|
`attachments` contain `kind`, `name`, `layout` (`file` or `tree`) and `entries`:
|
|
67
97
|
`{ type = "dir", path = "empty" }` or
|
|
68
98
|
`{ type = "file", path = "image.png", base64 = "…" }`. Common asset limits and
|
|
@@ -78,12 +108,45 @@ no continuous sync, assignee migration, state history or build-history migration
|
|
|
78
108
|
|
|
79
109
|
Integration-tree `kind` and `target` are preserved in portable frontmatter.
|
|
80
110
|
Import validates the complete target graph before changing the destination and
|
|
81
|
-
refuses a destination that cannot preserve metadata.
|
|
111
|
+
refuses a destination that cannot preserve metadata. Issue links and urgent
|
|
112
|
+
priority are preserved the same way, and a destination that cannot store them is refused before any write. It creates or adopts every
|
|
82
113
|
identity, establishes node kinds, then applies targets using the durable id map,
|
|
83
114
|
just like blockers. Input order does not matter. Resuming also restores edges on
|
|
84
115
|
adopted tickets; normal destination validation still guards existing graphs and
|
|
85
116
|
node demotion. Older work-only exports remain valid.
|
|
86
117
|
|
|
118
|
+
## GitHub
|
|
119
|
+
|
|
120
|
+
GitHub chooses issue numbers, so import into a `github` source remaps every
|
|
121
|
+
ticket. Check the printed mapping and `.ab-import-map.json`, which list each
|
|
122
|
+
original id with its new issue number. Blockers are rewritten through that
|
|
123
|
+
mapping and become native issue dependencies. Comments become issue comments,
|
|
124
|
+
and attachments go to the BuildStore under the new number. States become
|
|
125
|
+
`autobuild:<state>` labels. The done role closes the issue as completed, the
|
|
126
|
+
rejected role closes it as not planned, and triage leaves it open without a state
|
|
127
|
+
label. Each issue carries a creation key in a hidden marker, so an interrupted
|
|
128
|
+
import resumes with the same command and adopts the issues it already opened.
|
|
129
|
+
Resuming never duplicates an issue, and it replays missing blockers, comments and
|
|
130
|
+
assets.
|
|
131
|
+
|
|
132
|
+
Before any write, import reports every problem together: states that cannot be
|
|
133
|
+
`autobuild:` labels (for example `proposal`, or names that are not lowercase),
|
|
134
|
+
a rejected state when `[tickets].rejectedState` is unset, and ticket labels that
|
|
135
|
+
would collide with a state label (`autobuild:<state>`) or an issue-link label
|
|
136
|
+
(`autobuild-link:…`). The `autobuild:proposal` and `autobuild:aborted` marker
|
|
137
|
+
labels are ordinary labels and import as-is. Node kinds become the exact `node`
|
|
138
|
+
label, and targets become sub-issue relationships to the remapped node issues.
|
|
139
|
+
Issue links are kept. They are rewritten through the mapping only when the export
|
|
140
|
+
came from GitHub, because only then do they name the exported tickets.
|
|
141
|
+
|
|
142
|
+
Export from a `github` source covers every issue, closed ones included. It records
|
|
143
|
+
comment history with authors and timestamps, kinds, targets, blockers and issue links, and skips
|
|
144
|
+
pull requests. An issue it cannot read as a ticket, such as one with two state
|
|
145
|
+
labels, fails the export. Issues closed as not planned export in the rejected
|
|
146
|
+
role even when `[tickets].rejectedState` is unset. Export and import read comment
|
|
147
|
+
history explicitly. The GitHub source still lists no comment history in
|
|
148
|
+
`ab ticket show`, and dispatcher ticks never read it.
|
|
149
|
+
|
|
87
150
|
## In-flight builds
|
|
88
151
|
|
|
89
152
|
A recorded migration resolves old source-qualified ticket references through the
|
package/docs/ticket-sources.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "Tickets"
|
|
3
3
|
group: "reference"
|
|
4
|
-
description: "Configure file, Linear, or
|
|
4
|
+
description: "Configure file, Linear, hosted, or GitHub tickets and implement a ticket-source adapter."
|
|
5
5
|
label: "Ticket sources"
|
|
6
6
|
order: 13
|
|
7
7
|
---
|
|
@@ -21,6 +21,7 @@ Install with `bun add -d --exact @defrex/autobuild`. Examples are complete minim
|
|
|
21
21
|
| `file` | tickets you edit as plain files | none |
|
|
22
22
|
| `linear` | a team already grooming in Linear | `LINEAR_API_KEY` |
|
|
23
23
|
| `hosted` | a project tracker shared by agents and clients | saved `ab connect` credential |
|
|
24
|
+
| `github` | a team already working in the repository's GitHub issues | `GITHUB_TOKEN`, `GH_TOKEN` or `gh auth login` |
|
|
24
25
|
|
|
25
26
|
### Local files (`file`)
|
|
26
27
|
|
|
@@ -37,11 +38,14 @@ createState = "triage"
|
|
|
37
38
|
triageState = "triage"
|
|
38
39
|
proposalState = "triage"
|
|
39
40
|
doneState = "done"
|
|
41
|
+
backlogState = "backlog"
|
|
42
|
+
rejectedState = "rejected"
|
|
40
43
|
```
|
|
41
44
|
<!-- seam-config:end -->
|
|
42
45
|
|
|
43
46
|
- **States are directories** (`.tickets/ready/`, `.tickets/doing/`). Claims move to `doing`; `claimedState` isn't configurable.
|
|
44
47
|
- **Claiming** needs `readyState`, every `readyLabels` entry and resolved blockers; `[]` adds no label gate.
|
|
48
|
+
- **Backlog and rejected** directories are created on the first role move into them.
|
|
45
49
|
|
|
46
50
|
Initialize with `bun ab init`; manage with `bun ab ticket states` and the other ticket commands.
|
|
47
51
|
|
|
@@ -61,6 +65,7 @@ createState = "Backlog"
|
|
|
61
65
|
triageState = "Backlog"
|
|
62
66
|
proposalState = "Backlog"
|
|
63
67
|
doneState = "Done"
|
|
68
|
+
rejectedState = "Canceled"
|
|
64
69
|
```
|
|
65
70
|
<!-- seam-config:end -->
|
|
66
71
|
|
|
@@ -69,7 +74,9 @@ Replace `ENG` and the case-sensitive workflow names with your team's.
|
|
|
69
74
|
- **Admission.** `teamKey` selects the team; `readyState`, every `readyLabels` entry and optional `readyAssignee` filter it.
|
|
70
75
|
- **Labels.** `readyLabels` defaults to `["autobuild"]`; `[]` removes the gate.
|
|
71
76
|
- **No `project` key.** Scope the queue through team access, states and labels.
|
|
77
|
+
- **Priority.** Linear's Urgent priority reads as `urgent`; every other priority, including none, reads as `normal`. `--priority urgent` sets Urgent. `--priority normal` clears Urgent to No priority and leaves High, Medium or Low untouched.
|
|
72
78
|
- **Rate limits** are shared with your other API callers.
|
|
79
|
+
- **Backlog and rejected.** Neither role has a default, and neither may share a state with triage. Here `Backlog` is the triage state, so a deferred-work state needs its own name, such as `backlogState = "Icebox"`. Linear counts `Canceled` as complete; mapped to `rejectedState`, it no longer resolves blockers.
|
|
73
80
|
|
|
74
81
|
### Hosted (`hosted`)
|
|
75
82
|
|
|
@@ -94,21 +101,70 @@ createState = "triage"
|
|
|
94
101
|
triageState = "triage"
|
|
95
102
|
proposalState = "triage"
|
|
96
103
|
doneState = "done"
|
|
104
|
+
backlogState = "backlog"
|
|
105
|
+
rejectedState = "rejected"
|
|
97
106
|
```
|
|
98
107
|
<!-- seam-config:end -->
|
|
99
108
|
|
|
100
109
|
- `teamKey` identifies the registered project's team.
|
|
101
110
|
- **URL.** `tickets.url` defaults to the remote BuildStore service (`AB_STORE` or `[store].url`); it's required with a local Store, as here.
|
|
102
111
|
- **Authority.** A separate ticket service needs its own project credential; a Store connection grants nothing there. Delegated child sessions are read-only and can't redefine policy.
|
|
112
|
+
- **Backlog and rejected.** `ab connect` and every policy publication carry both roles, so operator and MCP role moves use them too. Mapping a role onto an existing state, such as `backlogState = "icebox"`, keeps that state and its tickets; a missing role state is created. Blocker facts carry each blocker's state, so a rejected blocker is named in diagnostics.
|
|
113
|
+
|
|
114
|
+
### GitHub (`github`)
|
|
115
|
+
|
|
116
|
+
Tickets are the issues of the forge repository, the GitHub repository that `origin` names, so a team grooms and tracks work where it already looks. The source authenticates as the `github` forge does: `GITHUB_TOKEN`, then `GH_TOKEN`, then the gh CLI's `gh auth login`. A fine-grained token needs Issues read and write, and Metadata read, on the repository, and a user token's user needs triage or write access: GitHub silently drops label changes from anyone below that, so a label write that doesn't come back fails with a permission error instead of reporting success. `ab init --validate` names a missing token, a token that can't read and write issues, a user who can't set labels, disabled issues, an `origin` that isn't a GitHub repository, a state that can't be a label, and a `readyAssignee` that names no user who can be assigned issues in the repository.
|
|
117
|
+
|
|
118
|
+
<!-- seam-config:start -->
|
|
119
|
+
```toml
|
|
120
|
+
[tickets]
|
|
121
|
+
source = "github"
|
|
122
|
+
readyState = "ready"
|
|
123
|
+
readyLabels = ["autobuild"]
|
|
124
|
+
claimedState = "doing"
|
|
125
|
+
createState = "triage"
|
|
126
|
+
triageState = "triage"
|
|
127
|
+
proposalState = "triage"
|
|
128
|
+
doneState = "done"
|
|
129
|
+
backlogState = "backlog"
|
|
130
|
+
rejectedState = "rejected"
|
|
131
|
+
```
|
|
132
|
+
<!-- seam-config:end -->
|
|
133
|
+
|
|
134
|
+
`source = "github"` alone is enough: every other key shown is its default, except the two roles, which `ab init` writes. `teamKey`, `dir` and `url` are refused.
|
|
135
|
+
|
|
136
|
+
- **Ids** are issue numbers; commands accept `123` and `#123`. Title, body and labels are the issue's. Pull requests are never tickets.
|
|
137
|
+
- **States are `autobuild:` labels.** An open issue with one `autobuild:<state>` label is in that state, and an open issue with none is in triage, so issues filed on GitHub arrive there. An issue with two or more state labels is left out of listings with a diagnostic naming it and its labels. `ab ticket state create icebox --about "…"` creates the `autobuild:icebox` label, with the purpose as its description. A name is one to forty lowercase letters, digits or hyphens, starting with a letter.
|
|
138
|
+
- **Closing reasons.** Closed as completed, or closed before GitHub recorded reasons, is done. Closed as not planned or duplicate is in the `rejectedState` state; without `rejectedState` it reads as a fixed `not-planned` state that is never ready, never resolves a blocker and can't be moved into. Moving to done or rejected closes the issue with that reason (an issue already closed with the other reason is reopened and closed again, because GitHub changes a reason only with the state); moving to any other state opens it with exactly that state's label.
|
|
139
|
+
- **Reopen goes to triage.** If a state label survived the close, the adapter strips that stale label the first time it reads the reopened issue. It tells stale from fresh by the issue's last 100 label and reopen events; an issue whose deciding event is older than that is left out of listings with a diagnostic until its state label is removed and re-added.
|
|
140
|
+
- **Labels.** `readyLabels` defaults to `["autobuild"]`; `[]` removes the gate. Missing labels are created on demand. State and link labels are never part of a ticket's labels, and a write that names one is refused. The `autobuild:proposal` and `autobuild:aborted` labels that harvest and abort apply are ordinary labels, so `proposal` and `aborted` can't be states.
|
|
141
|
+
- **Assignee.** `readyAssignee = "me"` keeps only issues assigned to the login that owns the GitHub credential; a username, including an Enterprise Managed User login such as `mona_acme`, names a specific user. The ready read itself is narrowed by assignee, an unassigned issue is never ready, and any one of several assignees matches. `"me"` costs one `GET /user` per dispatcher start, never during a tick, so a reload that enables it needs no restart unless startup couldn't resolve the credential's owner.
|
|
142
|
+
- **Blockers** are native issue dependencies ("blocked by"), visible on both issues, including ones added on GitHub. A blocker resolves when its issue is done. One in another repository never resolves and is named in the dependency diagnostics. An issue transferred to another repository is no longer a ticket here: its old number reads as missing, so it is never written and never resolves a blocker.
|
|
143
|
+
- **Issue links.** The ticket's own issue is always a `closes` link that can't be removed. Links to other issues are labels named `autobuild-link:<intent> #<n>`, such as `autobuild-link:refs #820`, so they show on the issue and survive edits on GitHub. Each linked issue and intent adds one repository label, which appears in GitHub's label picker; unused link labels are never deleted.
|
|
144
|
+
- **Comments and assets.** Dispatcher notices post as issue comments, but tickets carry no comment history, so `ab ticket show` lists none; export and import read comment history explicitly. Assets live in the BuildStore, with the usual note left as an issue comment.
|
|
145
|
+
- **Nodes and targets.** A node is an issue with the exact `node` label. A ticket targets a node by being a sub-issue of the node's issue, so the node's sub-issue list on GitHub shows its children. A parent without the `node` label, or in another repository, is ordinary grouping: it gives no target, never blocks dispatch and is left untouched, so `--target` on such an issue is refused and `--no-target` doesn't remove it. Sub-issues and `node` labels added or removed on GitHub read the same as `ab ticket` writes. GitHub allows 100 direct sub-issues per issue and 8 levels of nesting. A repository label named `Node` or another casing must be renamed to `node` first.
|
|
146
|
+
- **Export and import.** `ab ticket export` covers every issue, closed ones included. `ab ticket import` remaps every id to a new issue number and resumes by creation key, as the ticket migration procedure's GitHub section describes.
|
|
147
|
+
- **Not supported:** guarded writes (`--expected-revision` is refused, as with Linear).
|
|
148
|
+
- **Cost.** Dispatcher reads are conditional requests. Their validators live under the local state root, in `github-tickets/<owner>/<repo>/validators/`, and are evicted after 7 days unused, so a tick on an unchanged repository spends no primary rate-limit budget. A process without them, such as a cold hosted instance, pays one read sized by the ready candidates. A ready candidate whose parent issue isn't in the listing adds one conditional read of that parent, at most one per distinct parent. A node's completeness check reads the node issue and its sub-issues, conditionally, whatever the repository's size. Rate limits surface as the ticket-source rate-limit error, with GitHub's reset time.
|
|
149
|
+
- **State counts** are display-only: one fresh GraphQL request per call, plus one more for each further page of 100 `autobuild:` labels, never cached and never reading issue history, with done and rejected subject to GitHub's search-index lag. Three cases approximate. A stale reopen label counts in its label's state until the first read strips it. An issue with two or more state labels counts once in each until its labels are fixed; the first read reports it. A closure that predates GitHub's close reasons reads as done but may count as rejected or `not-planned`, and never heals.
|
|
150
|
+
- **Creation keys** live in a hidden marker in the issue body. A keyed create needs `idempotencyKeyReservedAt`; harvest supplies it.
|
|
151
|
+
|
|
152
|
+
### Optional issue links
|
|
153
|
+
|
|
154
|
+
The `file`, `hosted` and `github` sources store [forge issue links](tickets.md#groom-a-buildable-spec): as `issueLinks` frontmatter (`file`), transactional project data (`hosted`), or `autobuild-link:<intent> #<n>` labels (`github`), where the ticket's own issue is a `closes` link with no label. `linear` doesn't, because Linear links GitHub issues natively through its own integration; a create or update that names issue links is refused with an error naming the source, and nothing is written.
|
|
155
|
+
|
|
156
|
+
### Optional priority
|
|
157
|
+
|
|
158
|
+
A ticket is `urgent` or `normal` (the default); the dispatcher claims urgent ready work first. The `file` and `hosted` sources store priority: as `priority = "urgent"` frontmatter with no key for normal (`file`), or transactional project data covered by the ticket revision (`hosted`, whose ready listing returns urgent tickets first). `linear` uses its native Urgent priority, described in its section above.
|
|
103
159
|
|
|
104
160
|
### Optional ticket tree
|
|
105
161
|
|
|
106
|
-
|
|
162
|
+
The `file`, `hosted`, `linear` and `github` sources declare `integrationTree: true`, storing kind and target as frontmatter (`file`), transactional project data (`hosted`), the exact `node` label plus the parent relationship (`linear`), or the exact `node` label plus sub-issues (`github`).
|
|
107
163
|
|
|
108
164
|
- **Targets** resolve to canonical ids in the same source and pick the integration destination, not execution order; blockers are a separate graph. See [integration](integration-overview.md).
|
|
109
165
|
- **Updates.** Omitted `kind` or `target` keeps the value. New tickets default to work; `kind = "work"` resets kind; `target = null` clears a target in the typed API (not TOML syntax).
|
|
110
166
|
- **Validation.** Target existence, node kind, self/ancestor cycles, corrupt ancestor chains and demoting a node with children are checked before any write; invalid metadata rejects the whole patch.
|
|
111
|
-
- **Enumeration.** `listAll` lists every state, ignoring ready filters.
|
|
167
|
+
- **Enumeration.** `listAll` lists every state, ignoring ready filters. `listTargeting`, when provided, lists the tickets targeting one node and is what integration observation uses; `github` and `hosted` provide it.
|
|
112
168
|
- **Without the capability**, a source keeps CRUD but must refuse kind/target writes, not drop them.
|
|
113
169
|
|
|
114
170
|
## Writing your own
|
|
@@ -119,6 +175,7 @@ An adapter must:
|
|
|
119
175
|
|
|
120
176
|
- preserve lifecycle, claim and blocker-completion semantics
|
|
121
177
|
- create idempotently under retries, with stable visible creation keys
|
|
178
|
+
- if its key lookup is bounded by time, require `idempotencyKeyReservedAt`, the earliest time the key could first have been used, and refuse a keyed create without it
|
|
122
179
|
- return valid records from `listReady` with diagnostics for malformed ones, but propagate infrastructure failures
|
|
123
180
|
- declare revision support honestly: guarded writes reject stale revisions; unsupported guards fail explicitly
|
|
124
181
|
- never report success for a partial mixed update
|
|
@@ -129,6 +186,8 @@ Test with a `TicketSourceContractFactory` returning a `TicketSourceContractHarne
|
|
|
129
186
|
bun ab plugin test ticket-source acme
|
|
130
187
|
```
|
|
131
188
|
|
|
189
|
+
Declare `readyAssignee` only if `listReady` filters by `criteria.assignee`; without it, a configured `readyAssignee` is refused, naming your source. See the [optional ready assignee capability](plugin-authoring.md#optional-ready-assignee-capability).
|
|
190
|
+
|
|
132
191
|
Declare tree support only if you keep the [optional tree contract](plugin-authoring.md#optional-ticket-tree-capability) on the same port and harness: exhaustive pagination, canonical targets, revision coverage and atomic rejection.
|
|
133
192
|
|
|
134
193
|
Native paging is an optional API 1.9 ticket-source capability:
|
|
@@ -143,8 +202,26 @@ match the exhaustive listing. The shared `describeTicketSourceContract` suite
|
|
|
143
202
|
automatically compares declared native paging with full-read windows.
|
|
144
203
|
|
|
145
204
|
Only paged operator listings select this capability. Sources without it retain
|
|
146
|
-
the full-read
|
|
205
|
+
the full-read fallback, which orders the listing before offset and limit: by
|
|
206
|
+
default a stable urgent-first partition (urgent, then normal, each in source
|
|
207
|
+
order), or for newest the reversed source order. Native errors propagate. Unpaged operator
|
|
147
208
|
listings, CLI ticket lists and dispatcher ready scans remain exhaustive through
|
|
148
209
|
`listReady`/`listAll`. The hosted PostgreSQL source counts matches without
|
|
149
|
-
bodies and reads only the SQL-bounded window. File, Linear and the remote
|
|
210
|
+
bodies and reads only the SQL-bounded window. File, Linear, GitHub and the remote
|
|
150
211
|
`HostedTicketSource` retain fallback; the POST list-ready protocol stays exhaustive.
|
|
212
|
+
|
|
213
|
+
Bounded state counts are another optional capability:
|
|
214
|
+
`countStates?(names: readonly string[]): Promise<TicketStateCount[]>`. It returns
|
|
215
|
+
`{name, tickets}` for each requested name that resolves (exactly, else by one
|
|
216
|
+
case-insensitive match) and never returns ticket rows. Only interactive
|
|
217
|
+
dashboards and viewers read it, for the header's triage count: a dashboard
|
|
218
|
+
viewer, or a dispatcher driving an interactive dashboard or feeding a viewer,
|
|
219
|
+
samples it in the background at most once per 60 s, never inside a dispatcher
|
|
220
|
+
tick. Without it, the header shows `–`, and nothing falls back to a listing. A store-backed source should answer from maintained
|
|
221
|
+
totals so the cost does not grow with the number of tickets: the hosted
|
|
222
|
+
PostgreSQL source reads trigger-maintained totals, and the remote
|
|
223
|
+
`HostedTicketSource` forwards the read to the server. The file source counts
|
|
224
|
+
each matched state's directory entries without parsing a ticket, so its local
|
|
225
|
+
cost grows with the files in that state. The GitHub source sends one GraphQL request per call, plus one per further page of 100 `autobuild:` labels, so its cost grows with matching labels rather than tickets, and keeps no count between calls. Linear does not implement it. When a source declares
|
|
226
|
+
both `countStates` and `listStates`, the shared contract suite checks that they
|
|
227
|
+
agree.
|
package/docs/tickets.md
CHANGED
|
@@ -13,11 +13,12 @@ A ticket says what change to make and why. The tracker is the input; the build's
|
|
|
13
13
|
|
|
14
14
|
## Choose a source
|
|
15
15
|
|
|
16
|
-
Autobuild ships
|
|
16
|
+
Autobuild ships four ticket sources; plugins can register more through the same port:
|
|
17
17
|
|
|
18
18
|
- **File** stores tickets in lifecycle directories.
|
|
19
19
|
- **Linear** (direct) uses your team's workflow.
|
|
20
20
|
- **Hosted** is its own project-scoped service, not a Linear proxy.
|
|
21
|
+
- **GitHub** uses the repository's own issues, with states as labels.
|
|
21
22
|
|
|
22
23
|
The source supplies content, workflow states, labels, and blockers; configuration picks the source and ready gate. Everything else is source-agnostic.
|
|
23
24
|
|
|
@@ -40,13 +41,44 @@ The spec standard asks for:
|
|
|
40
41
|
|
|
41
42
|
Your operator agent grooms the ticket with you using `ab-spec`, then moves it to the ready state with any required labels. Dispatch's spec gate returns ready tickets that can't become conforming specs to Triage with an explanation.
|
|
42
43
|
|
|
44
|
+
When the work comes from a forge issue, record it on the ticket: `--issues 824` when the ticket fully resolves issue #824 (`closes`, the default), or `--issues 820:refs` when it only partly addresses it. `ab ticket update --issues` replaces the set and `--issues ''` clears it. Sources that can't store issue links refuse the write and name the source.
|
|
45
|
+
|
|
46
|
+
A build freezes the links when it claims the ticket. On GitHub, a leaf build that targets the default branch writes `Closes #824` or `Refs #820` lines at the end of its PR body and before the trailers of its landed commit, so merging closes each fully resolved issue and back-links the rest. A leaf that targets a node branch writes only `Refs` lines into its PR body, which never close anything, and none into its landed commit; its links ride up to the root node's PR into the default branch, together with the node's own links, so they close when the node lands. A build that turns out to only partly resolve an issue downgrades it to `refs` with a recorded reason.
|
|
47
|
+
|
|
48
|
+
```sh
|
|
49
|
+
bun ab ticket create "Close stale sandboxes" --body spec.md --issues 824,820:refs
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
When a ticket must go next, such as a fix for a stuck build, mark it urgent instead of moving other tickets out of ready: `--priority urgent` on `ab ticket create` or `ab ticket update`. `--priority normal` removes it. The `file`, `hosted` and `linear` sources store priority. See [Ticket sources](ticket-sources.md#shipped-adapters).
|
|
53
|
+
|
|
54
|
+
```sh
|
|
55
|
+
bun ab ticket update AUT-12 --priority urgent
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
## Backlog and rejected
|
|
60
|
+
|
|
61
|
+
Two optional lifecycle roles sit beside triage, ready, claimed and done:
|
|
62
|
+
|
|
63
|
+
- **Backlog** holds work you deferred on purpose. Nothing dispatches from it.
|
|
64
|
+
- **Rejected** holds work you considered and declined. A rejected ticket never unblocks the tickets it blocks, and a rejected child no longer holds its node open.
|
|
65
|
+
|
|
66
|
+
Both roles are recommended. Map each to a native state with `[tickets].backlogState` and `[tickets].rejectedState`; `ab init` writes `backlog` and `rejected` for the file, hosted and GitHub sources, and a Linear team might use `Icebox` and `Canceled`. With a key unset, that role doesn't exist. Your operator agent moves tickets by role, so it never needs your native names:
|
|
67
|
+
|
|
68
|
+
```sh
|
|
69
|
+
bun ab ticket move AUT-12 --role backlog
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Moving a ticket back to triage, backlog or ready restores ordinary behavior. "Building" isn't a role you move work into: it's the claimed state (`doing` for the file source), which the dispatcher sets.
|
|
43
73
|
|
|
44
74
|
## Ready is a gate, not a guarantee
|
|
45
75
|
|
|
46
76
|
The dispatcher claims only tickets in the ready state with the required labels and any source-specific filter. A ready ticket still waits on:
|
|
47
77
|
|
|
48
78
|
- **Blockers.** Unresolved prerequisite tickets keep it queued; they don't create a blocked build. With nodes, prerequisites with builds must be present at the sampled destination; see [integration and blocker presence](integration-overview.md).
|
|
49
|
-
- **Destination and capacity.** Its target must accept new work, and a capacity slot must be free.
|
|
79
|
+
- **Destination and capacity.** Its target must accept new work, and a capacity slot must be free and not reserved for an integration node awaiting verification.
|
|
80
|
+
|
|
81
|
+
When a slot is free, the dispatcher takes urgent ready tickets first, then normal ones, each in the source's order. Priority changes only that order: a blocked urgent ticket waits like any other while normal work proceeds, and an urgent ticket never stops or pauses a running build. The web dashboard's Queue tab lists tickets in the same order and marks urgent ones `URGENT`; the mark shows priority, not that the ticket will dispatch next.
|
|
50
82
|
|
|
51
83
|
Before ready filing, the agent checks `ab repository status --json`. With live
|
|
52
84
|
`operator.registrations`, it records intent, rejected alternatives and out-of-scope
|
package/docs/troubleshooting.md
CHANGED
|
@@ -55,7 +55,7 @@ bun ab harvest status
|
|
|
55
55
|
|
|
56
56
|
- **Intake and pause:** intake on, repository not paused. Resume a deliberately paused repository only when work should proceed.
|
|
57
57
|
- **Ready state:** ticket in the exact ready state with every required label.
|
|
58
|
-
- **Blockers and destination:** blockers done, target node open, required changes in the destination.
|
|
58
|
+
- **Blockers and destination:** blockers done, target node open, required changes in the destination. A target node built by another dispatcher's store never opens here; see [several dispatchers](build-store.md#several-dispatchers-on-one-repository). `ab repository status` lists the queue diagnostics.
|
|
59
59
|
- **Claims:** claimed tickets aren't reclaimed.
|
|
60
60
|
- **Capacity:** paused or blocked work keeps its slot; idle collecting nodes take none. Node verification and reconciliation account specially for descendants' slots.
|
|
61
61
|
- **Harvest:** check the acknowledged harvest gate and unclaimed observations. Harvest triggers at `policy.harvestThreshold` observations, or `policy.harvestMaxDrift` other merged builds since the oldest observation (zero disables drift), and uses no build slot.
|
|
@@ -67,7 +67,7 @@ bun ab harvest status
|
|
|
67
67
|
| Component | Check |
|
|
68
68
|
|---|---|
|
|
69
69
|
| Linear | `LINEAR_API_KEY`, team and workflow states, in the actual process environment or supported `.env` |
|
|
70
|
-
| GitHub | `gh auth status` and repository permissions; test Git fetch and push separately |
|
|
70
|
+
| GitHub | `gh auth status` and repository permissions; test Git fetch and push separately. With `source = "github"` tickets, the same token needs Issues read and write |
|
|
71
71
|
| Agent providers | The effective role's runtime: `codex login` when the Codex diagnostic asks; for Pi, provider login and the provider-qualified model |
|
|
72
72
|
| Hosted store | `bun ab connect` for service, project and credential status |
|
|
73
73
|
|
package/docs/verification.md
CHANGED
|
@@ -59,7 +59,7 @@ For example: `steps = ["types", ["unit", "integration"], ["acceptance", "docs"]]
|
|
|
59
59
|
| `agent` | the exact `skill` you configure ([repository-local](skills.md#add-a-repository-local-skill), no prefix inferred) | `ab verdict` records pass, fail or skip |
|
|
60
60
|
|
|
61
61
|
- **Pass** satisfies the member; the next stage waits for its siblings.
|
|
62
|
-
- **Fail**, after its stage settles, sends all failed reports back through implement and code review, then verification, up to `[policy].maxVerifyAttempts`; then the build escalates.
|
|
62
|
+
- **Fail**, after its stage settles, sends all failed reports back through implement and code review, then verification, up to `[policy].maxVerifyAttempts`; then the build escalates. That budget is build-wide, so the escalation lists every counted failed attempt and its failed steps, and says a step failed in every counted cycle only when it did.
|
|
63
63
|
- **Skip** satisfies its member without counting as a pass or spending retries. Plan exclusions and path misses skip deterministically. An agent may skip only when the whole step doesn't apply, with a reason; an applicable behavior it can't exercise is a failure.
|
|
64
64
|
|
|
65
65
|
## Select what a build needs
|
|
@@ -167,17 +167,17 @@ Autobuild's own chain: this repository's choices, not defaults.
|
|
|
167
167
|
|---|---|---|---|
|
|
168
168
|
| 1 | lint | check | formatting and lint; mandatory |
|
|
169
169
|
| 2 | types | check | TypeScript type checking |
|
|
170
|
-
| 3 | unit | check | the test suite
|
|
170
|
+
| 3 | unit | check | the in-memory test suite; a guard fails any test that does IO |
|
|
171
171
|
| 4 | build | check | packs every publishable package and checks its contents, imports and bins; mandatory |
|
|
172
|
-
| 5 | integration | check |
|
|
172
|
+
| 5 | integration | check | every IO test (filesystem, processes, network, real time) plus database-backed suites and a packed hosted-service deploy rehearsal; runs concurrently with unit and build |
|
|
173
173
|
| 6 | ui-tui | agent | captures terminal-dashboard frames and judges them |
|
|
174
174
|
| 7 | ui-app | agent | captures operator web-app frames and judges them against the design |
|
|
175
175
|
| 8 | ui-website | agent | captures site and docs frames at desktop and phone widths, compared with approved references |
|
|
176
176
|
| 9 | docs | agent | fails when a `docs/` passage no longer matches the build's user-facing changes |
|
|
177
177
|
|
|
178
|
-
Steps 5 to 9 are optional
|
|
178
|
+
Steps 5 to 9 are optional. Integration covers every package plus `tools/`, `scripts/` and `bin/`, and applies to every build because many of its tests check skills, docs and configuration. Steps 6 to 9 are path-scoped and run through repository skills `verify-ui-tui`, `verify-ui-app`, `verify-ui-website` and `verify-docs`. The docs step applies to product source, skills, templates, `SPEC.md`, `README.md` and `docs/`.
|
|
179
179
|
|
|
180
|
-
A plan for a docs change like this page selects lint, types, unit, build, ui-website and docs; both of the last two pass their path checks because they cover `docs/`. The untouched ui-tui and ui-app steps aren't selected.
|
|
180
|
+
A plan for a docs change like this page selects lint, types, unit, build, integration, ui-website and docs; both of the last two pass their path checks because they cover `docs/`. The untouched ui-tui and ui-app steps aren't selected.
|
|
181
181
|
|
|
182
182
|
Grouped failures retain the legacy `feedback.verify` object for the first report
|
|
183
183
|
in configured order. A decisive `verify.stage-failed` receipt carries the full
|
package/docs/website.md
CHANGED
|
@@ -41,6 +41,14 @@ registry edit. `bun run capture:website` captures every generated docs page at
|
|
|
41
41
|
`.ab/website-frames/`. Static hosts must serve directory index files. The dev
|
|
42
42
|
server redirects slashless docs URLs to canonical trailing-slash paths.
|
|
43
43
|
|
|
44
|
+
Each published page has a snapshot of its text hash, headings, code and
|
|
45
|
+
metadata in `packages/website/src/docs-baseline/<source stem>.json`, and the
|
|
46
|
+
website docs integration test fails when one is stale. After changing,
|
|
47
|
+
adding or removing a published page, or when a reconcile meets a conflict in
|
|
48
|
+
that directory, run `bun run docs:baseline` and commit its output instead of
|
|
49
|
+
hand-editing or hand-merging it. The command is idempotent and removes files
|
|
50
|
+
for pages that are no longer published.
|
|
51
|
+
|
|
44
52
|
`bun run check` enforces complete-byte parity for same-named files shared by
|
|
45
53
|
`docs/` and `skills/guide/references/`, including their live and pristine installed
|
|
46
54
|
copies. Edit docs first and synchronize all three guide copies in the same
|
package/docs/workspaces.md
CHANGED
|
@@ -112,7 +112,7 @@ Sandbox preparation order:
|
|
|
112
112
|
|
|
113
113
|
- **Runtimes.** Every primary and alternate runtime needs a pinned install and exact-version preflight, and gets only the credentials named in `environmentVariables`, except declared [accounts](configuration-overview.md#accounts), whose credentials remain on the host and are brokered by egress policy using guest placeholders.
|
|
114
114
|
- **Repetition.** New sandboxes repeat provisioning and preflights rerun before each build-runner; keep setup idempotent.
|
|
115
|
-
- **Validation.** `bun ab init --validate` runs named provisioning, setup, runtime and Store checks in a disposable environment, deletes it even on failure, and starts no build. For every declared account, including unused accounts, it runs a tool-free model probe through the account's runtime (Claude Code for Claude/Kimi, Codex for ChatGPT); these probes create no ordinary build phase or persistent agent session. Hosted ChatGPT project secrets report readiness from write-only status metadata instead; the first hosted build is the live check.
|
|
115
|
+
- **Validation.** `bun ab init --validate` runs named provisioning, setup, runtime and Store checks in a disposable environment, deletes it even on failure, and starts no build. For every declared account, including unused accounts, it runs a tool-free model probe through the account's runtime (Claude Code for Claude/Kimi, Codex for ChatGPT); these probes create no ordinary build phase or persistent agent session. Hosted ChatGPT, Claude and Kimi project secrets report readiness from write-only status metadata instead; the first hosted build is the live check.
|
|
116
116
|
- **Lifetime.** `timeoutSeconds` bounds a sandbox; provider operations have their own timeouts. An intact sandbox resumes. Before replacement, the dispatcher fences it, preserves reachable unpublished commits to build-private refs, and records a receipt; the next workspace restores those commits. Loss is limited to already absent or unrecoverable work and uncommitted files; known loss appears in the next session's recovery context. See the [workspace recovery contract](architecture.md#key-boundaries).
|
|
117
117
|
|
|
118
118
|
### Private repositories
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@defrex/autobuild",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "Agent-driven software delivery from groomed ticket to merged PR",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -135,6 +135,7 @@
|
|
|
135
135
|
"release": "bun tools/release.ts",
|
|
136
136
|
"postgres:migrate": "bun packages/postgres-store/src/bin.ts migrate",
|
|
137
137
|
"docs:configuration": "bun tools/configuration-reference.ts --write",
|
|
138
|
+
"docs:baseline": "bun packages/website/src/docs-baseline.ts",
|
|
138
139
|
"check": "bun tools/biome-check.ts && bun tools/product-name-check.ts && bun tools/docs-asset-check.ts && bun tools/reducer-value-shapes.ts --check && bun tools/configuration-reference.ts --check && bun tools/docs-reference-sync.ts && bun tools/docs-integrity-check.ts && bun tools/skill-docs-asset-check.ts && bun tools/readme-headline.ts --check && bun tools/website-hero.ts --check && bun tools/package-boundary-check.ts && bun tools/publish-dependencies-check.ts",
|
|
139
140
|
"check:build": "bun tools/workspace-manifest-check.ts && bun tools/bin-mode-check.ts && bun tools/publish-contents-check.ts && bun tools/publish-imports-check.ts",
|
|
140
141
|
"format:staged": "git-format-staged --formatter './node_modules/.bin/biome format --stdin-file-path {}' '*.js' '*.jsx' '*.ts' '*.tsx' '*.json' '*.jsonc' '*.css' '*.graphql' '*.gql'",
|
|
@@ -156,8 +157,8 @@
|
|
|
156
157
|
},
|
|
157
158
|
"devDependencies": {
|
|
158
159
|
"@biomejs/biome": "2.5.5",
|
|
159
|
-
"@defrex/autobuild-postgres-store": "1.
|
|
160
|
-
"@defrex/autobuild-vercel-sandbox": "1.
|
|
160
|
+
"@defrex/autobuild-postgres-store": "1.5.0",
|
|
161
|
+
"@defrex/autobuild-vercel-sandbox": "1.5.0",
|
|
161
162
|
"@resvg/resvg-js": "2.6.2",
|
|
162
163
|
"@types/bun": "^1.3.14",
|
|
163
164
|
"@types/node": "^24.0.0",
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Init validation's hosted metadata readiness boundary. Accounts whose
|
|
3
|
+
* credential is checked only from project-secret metadata are listed by name
|
|
4
|
+
* in this variable so the guest probe skips their live model request; the
|
|
5
|
+
* value is a JSON list of account names, never credential values.
|
|
6
|
+
*/
|
|
7
|
+
export const HOSTED_ACCOUNT_READINESS_ENV = 'AB_HOSTED_ACCOUNT_READINESS'
|
|
8
|
+
|
|
9
|
+
/** Stands in for a hosted credential during validation; the real value is never downloaded. */
|
|
10
|
+
export const HOSTED_METADATA_PLACEHOLDER = 'autobuild-hosted-metadata-only'
|
|
11
|
+
|
|
12
|
+
export function hostedReadinessNames(env: Readonly<Record<string, string | undefined>>): string[] {
|
|
13
|
+
return JSON.parse(env[HOSTED_ACCOUNT_READINESS_ENV] ?? '[]') as string[]
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function withHostedReadiness(
|
|
17
|
+
env: Readonly<Record<string, string | undefined>>,
|
|
18
|
+
name: string,
|
|
19
|
+
): string {
|
|
20
|
+
return JSON.stringify([...hostedReadinessNames(env), name])
|
|
21
|
+
}
|
|
@@ -61,6 +61,7 @@ export function repositoryNeedsAttention(event: RepositoryEvent): boolean {
|
|
|
61
61
|
case 'dispatcher.config-rejected':
|
|
62
62
|
case 'dispatcher.runtime-rolled-back':
|
|
63
63
|
case 'dispatcher.upgrade-failed':
|
|
64
|
+
case 'dispatcher.kernel-git-unavailable':
|
|
64
65
|
return true
|
|
65
66
|
case 'dispatcher.config-reloaded':
|
|
66
67
|
return event.payload.restartRequired.length > 0
|