@defrex/autobuild 1.0.0-beta.2 → 1.0.0-beta.3
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/SPEC.md +25 -3
- package/docs/architecture.md +4 -0
- package/docs/integration-tree.md +4 -2
- package/docs/remote-store-protocol.md +5 -0
- package/docs/remote-ticket-protocol.md +5 -0
- package/docs/setup.md +4 -0
- package/docs/spec-standard.md +71 -0
- package/docs/ticket-migration.md +50 -4
- package/package.json +3 -3
- package/packages/core/src/cli/build-control.ts +3 -3
- package/packages/core/src/cli/dashboard/integration-detail.ts +8 -6
- package/packages/core/src/cli/dashboard/integration-row.ts +15 -8
- package/packages/core/src/cli/dashboard/model.ts +7 -0
- package/packages/core/src/cli/dispatch-frontend.ts +5 -0
- package/packages/core/src/cli/dispatch-repository-feed.ts +2 -1
- package/packages/core/src/cli/dispatch.ts +5 -0
- package/packages/core/src/cli/help.ts +1 -0
- package/packages/core/src/cli/main.ts +11 -8
- package/packages/core/src/cli/repository-status.ts +7 -1
- package/packages/core/src/cli/ticket.ts +35 -11
- package/packages/core/src/events/payloads.ts +2 -0
- package/packages/core/src/events/policy.ts +1 -0
- package/packages/core/src/events/repository.ts +21 -0
- package/packages/core/src/kernel/__snapshots__/reducer-accumulator-shapes.json +4025 -3978
- package/packages/core/src/kernel/change-presence.ts +7 -1
- package/packages/core/src/kernel/dispatch-capacity.ts +12 -4
- package/packages/core/src/kernel/integration-completeness.ts +54 -16
- package/packages/core/src/kernel/node-parent.ts +35 -10
- package/packages/core/src/kernel/read-facts.ts +7 -0
- package/packages/core/src/kernel/reducer-registry.ts +3 -0
- package/packages/core/src/kernel/reducer.ts +1 -1
- package/packages/core/src/kernel/ticket-migrations.ts +139 -0
- package/packages/core/src/operator/query.ts +7 -1
- package/packages/core/src/operator/tickets.ts +30 -26
- package/packages/core/src/ports/tickets/linear.ts +180 -12
- package/packages/core/src/ports/tickets/migration.ts +92 -9
- package/packages/core/src/ports/types.ts +7 -0
- package/packages/core/src/processes/dispatcher.ts +164 -36
- package/packages/core/src/store/contract.ts +30 -0
- package/packages/core/src/store/reducer-value-shapes.json +5735 -5642
- package/packages/core/src/store/repo-state-events.ts +3 -2
- package/packages/core/src/testing/dispatch-read-budget.ts +3 -2
- package/skills/guide/SKILL.md +3 -1
- package/skills/guide/references/integration-tree.md +4 -2
- package/skills/guide/references/remote-store-protocol.md +5 -0
- package/skills/guide/references/remote-ticket-protocol.md +5 -0
- package/skills/guide/references/setup.md +4 -0
- package/skills/guide/references/spec-standard.md +71 -0
- package/skills/guide/references/ticket-migration.md +50 -4
- package/skills/spec/SKILL.md +16 -4
|
@@ -23,6 +23,7 @@ const RUN_STARTED = 'dispatcher.run-started'
|
|
|
23
23
|
* setting types are enumerated because they share one schema group with the
|
|
24
24
|
* run-correlated `dispatcher.config-reloaded`. */
|
|
25
25
|
export const REPOSITORY_STATE_EVENT_TYPES: readonly RepositoryEventType[] = [
|
|
26
|
+
'tickets.migration-recorded',
|
|
26
27
|
'dispatcher.forge-degraded',
|
|
27
28
|
'dispatcher.forge-recovered',
|
|
28
29
|
...Object.keys(changePresenceEventPayloadSchemas),
|
|
@@ -105,7 +106,7 @@ export interface RepositoryStateEventsAcc {
|
|
|
105
106
|
}
|
|
106
107
|
|
|
107
108
|
/** Bump when `RepositoryStateEventsAcc` or its fold changes. */
|
|
108
|
-
export const REPOSITORY_STATE_EVENTS_REDUCER_VERSION =
|
|
109
|
+
export const REPOSITORY_STATE_EVENTS_REDUCER_VERSION = 5
|
|
109
110
|
|
|
110
111
|
const keeps = (event: RepositoryEvent, anchor: number | undefined): boolean =>
|
|
111
112
|
STATE_TYPES.has(event.type) ||
|
|
@@ -153,7 +154,7 @@ export interface JournalViewAcc {
|
|
|
153
154
|
}
|
|
154
155
|
|
|
155
156
|
/** Bump when `JournalViewAcc` or its fold changes. */
|
|
156
|
-
export const JOURNAL_VIEW_REDUCER_VERSION =
|
|
157
|
+
export const JOURNAL_VIEW_REDUCER_VERSION = 6
|
|
157
158
|
|
|
158
159
|
/** Fold seq-ordered events into a journal view in place. */
|
|
159
160
|
export function foldJournalView(acc: JournalViewAcc, events: readonly RepositoryEvent[]): void {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { dispatchFrontendReducer } from '../cli/dispatch-repository-feed'
|
|
1
2
|
import { loadReducerSnapshot } from '../store/snapshots'
|
|
2
3
|
import { expect } from 'bun:test'
|
|
3
4
|
import { DispatchFrontend } from '../cli/dispatch-frontend'
|
|
@@ -152,7 +153,7 @@ export async function dispatchReadBudget(store: BuildStore, backing: BuildStore)
|
|
|
152
153
|
{ getReducerSnapshot: getSnapshot },
|
|
153
154
|
{ kind: 'repo', repo },
|
|
154
155
|
'dispatchFrontend',
|
|
155
|
-
{ version:
|
|
156
|
+
{ version: dispatchFrontendReducer.version },
|
|
156
157
|
)
|
|
157
158
|
)?.state,
|
|
158
159
|
).length
|
|
@@ -192,7 +193,7 @@ export async function dispatchReadBudget(store: BuildStore, backing: BuildStore)
|
|
|
192
193
|
{ getReducerSnapshot: getSnapshot },
|
|
193
194
|
{ kind: 'repo', repo },
|
|
194
195
|
'dispatchFrontend',
|
|
195
|
-
{ version:
|
|
196
|
+
{ version: dispatchFrontendReducer.version },
|
|
196
197
|
)
|
|
197
198
|
)?.state,
|
|
198
199
|
).length
|
package/skills/guide/SKILL.md
CHANGED
|
@@ -23,6 +23,7 @@ Idle nodes consume no runner capacity and empty nodes have no PR.
|
|
|
23
23
|
- [Landing policy, examples and forge requirements](references/landing-policy.md)
|
|
24
24
|
- [Restacking, identity and recovery](references/restacking.md)
|
|
25
25
|
- [Migration from 0.x](references/migration-1.0.md)
|
|
26
|
+
- [Moving ticket sources](references/ticket-migration.md): recorded migrations preserve in-flight build continuity.
|
|
26
27
|
|
|
27
28
|
## How to use this skill
|
|
28
29
|
|
|
@@ -1649,7 +1650,8 @@ it after the bounded stop delay when necessary, and only then releases the lease
|
|
|
1649
1650
|
The dispatcher defers cleanup while that lease is live, then performs the
|
|
1650
1651
|
checkpointed, retry-safe cleanup: close an open unmerged PR, release the workspace,
|
|
1651
1652
|
delete the exact remote and local build branches, preserve existing ticket labels
|
|
1652
|
-
while adding `autobuild:aborted`,
|
|
1653
|
+
while adding `autobuild:aborted`, return the ticket to configured Triage, and post
|
|
1654
|
+
an abort notice before
|
|
1653
1655
|
completing as `abandoned`. Missing
|
|
1654
1656
|
Forge cleanup capabilities or provider outages leave cleanup pending with an
|
|
1655
1657
|
actionable diagnostic for the next tick.
|
|
@@ -19,8 +19,10 @@ ancestor and demand the minimal restack path; same-node landings satisfy presenc
|
|
|
19
19
|
|
|
20
20
|
## Choosing a destination
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
First decide whether the feature should be more than one ticket at all; the
|
|
23
|
+
[spec standard](spec-standard.md#sizing-and-splitting) prefers fewer, larger
|
|
24
|
+
tickets cut at seams. Whenever grooming produces more than one ticket for a
|
|
25
|
+
feature, explicitly choose root or a node before filing. Use a node when the set should reach the base branch
|
|
24
26
|
as one integrated change, or intermediate states should not ship independently.
|
|
25
27
|
Use root when every ticket is independently valuable and safe to land alone.
|
|
26
28
|
Nested nodes can collect a subfeature before contributing it to a larger feature.
|
|
@@ -1329,3 +1329,8 @@ The optional `integrationAuditPending` digest fact is introduced on the 0.14
|
|
|
1329
1329
|
release line without changing protocol identity 4. It survives build completion
|
|
1330
1330
|
and is cleared by audit settlement. Services omit it for historical 0.12/0.13
|
|
1331
1331
|
clients, retaining their decoders and the supported three-line window.
|
|
1332
|
+
|
|
1333
|
+
`tickets.migration-recorded` is a durable, decisive human-authored repository
|
|
1334
|
+
fact: `{ identity, from, to, mapping }`, where mapping contains source ticket IDs
|
|
1335
|
+
and destination IDs. All migration facts survive dispatcher-run turnover.
|
|
1336
|
+
Conflicting identity reuse or source-qualified mappings fail replay closed.
|
|
@@ -333,3 +333,8 @@ client version. Without it, both fields are projected away, preserving historica
|
|
|
333
333
|
strict decoders. Current hosted clients send all three capability headers and
|
|
334
334
|
default absent kind to `work`. Unfiltered listing includes all ticket states and
|
|
335
335
|
empty nodes for `ab ticket tree`; dispatch and landing behavior are unchanged.
|
|
336
|
+
|
|
337
|
+
Completed ticket imports record `tickets.migration-recorded` in the selected
|
|
338
|
+
BuildStore repository journal, with export identity, origin/destination adapter
|
|
339
|
+
names and the actual complete ID mapping. Requested-ID preservation alone does
|
|
340
|
+
not establish continuity for in-flight builds; see the migration procedure.
|
|
@@ -541,3 +541,7 @@ gate. External orchestrators follow these through `ab watch` with no slugs or an
|
|
|
541
541
|
explicit repository watch; `ab wait` remains build-only. The dashboard and operator
|
|
542
542
|
repository query retain all failures for that run. After correcting settings or
|
|
543
543
|
access, revalidate and restart dispatch to refresh its startup diagnostics.
|
|
544
|
+
|
|
545
|
+
Changing the connected ticket source does not itself migrate in-flight builds.
|
|
546
|
+
Follow [ticket migration](ticket-migration.md), keeping the existing BuildStore
|
|
547
|
+
and recording continuity before resuming build-related ticket writes.
|
|
@@ -54,6 +54,77 @@ evidence is not.
|
|
|
54
54
|
|
|
55
55
|
---
|
|
56
56
|
|
|
57
|
+
## Sizing and splitting
|
|
58
|
+
|
|
59
|
+
Every build pays a fixed cost no matter how small its diff: spec, plan and
|
|
60
|
+
plan review, code review, the repository's full verify suite, finalize,
|
|
61
|
+
landing, and a restack for everything queued behind it. Ten small tickets pay
|
|
62
|
+
that cost ten times, and a blocker chain pays it in series. Prefer fewer,
|
|
63
|
+
larger tickets: one ticket per coherent change, as large as one plan and one
|
|
64
|
+
review pass can hold without the quality bar slipping.
|
|
65
|
+
|
|
66
|
+
A ticket is the right size when its acceptance criteria describe one feature
|
|
67
|
+
or fix a reviewer can judge in a single pass, one plan can cover it without
|
|
68
|
+
deferring a design decision to a later build, and its out-of-scope list is
|
|
69
|
+
short and obvious. It is too big when its criteria fall into groups that share
|
|
70
|
+
no behavior, when part of it waits on a decision nobody has made, or when its
|
|
71
|
+
parts need different landing — one can ship now while another needs consent
|
|
72
|
+
or must wait.
|
|
73
|
+
|
|
74
|
+
Do not split:
|
|
75
|
+
|
|
76
|
+
- by layer (schema, then API, then UI) when the layers make one behavior
|
|
77
|
+
change;
|
|
78
|
+
- into "refactor, then feature" unless the refactor is valuable and safe on
|
|
79
|
+
its own;
|
|
80
|
+
- to make progress visible, or because the spec got long. A long spec with
|
|
81
|
+
clear criteria is fine.
|
|
82
|
+
|
|
83
|
+
### Cut along seams
|
|
84
|
+
|
|
85
|
+
A seam decides where to cut once a split is justified; it is not a reason to
|
|
86
|
+
split. A full-stack change that crosses an API boundary stays one ticket
|
|
87
|
+
unless its size says otherwise.
|
|
88
|
+
|
|
89
|
+
When a feature does need several tickets, find the seams before deciding the
|
|
90
|
+
cut: places where the code already has a narrow, stable contract between
|
|
91
|
+
parts — a port or adapter interface, a schema or event type, a wire protocol,
|
|
92
|
+
a CLI command's output, a module's public API. Read the code to find them;
|
|
93
|
+
don't guess. Put each ticket on one side of a seam.
|
|
94
|
+
|
|
95
|
+
A cut at a seam pays twice:
|
|
96
|
+
|
|
97
|
+
- **Fewer conflicts.** Tickets on opposite sides of a contract touch
|
|
98
|
+
different code, so they build in parallel and restack cleanly. Two tickets
|
|
99
|
+
that would edit the same functions are one ticket, or a blocker chain.
|
|
100
|
+
- **Testability.** The contract is the test boundary. Each side is verified
|
|
101
|
+
against it — the provider by contract tests, the consumer against a fake or
|
|
102
|
+
fixture — so neither build needs the other to prove it works.
|
|
103
|
+
|
|
104
|
+
If no seam exists where the work divides, keep it as one ticket, or make the
|
|
105
|
+
first ticket establish the contract with tests at the boundary and block the
|
|
106
|
+
tickets on either side of it until it lands. After that, they can build
|
|
107
|
+
concurrently.
|
|
108
|
+
|
|
109
|
+
State the seam in each ticket as behavior, not structure: what the contract
|
|
110
|
+
promises observably (the event, the command output, the protocol response) is
|
|
111
|
+
a fair acceptance criterion on both sides; file names and signatures still
|
|
112
|
+
belong to the planner. Record in Evidence why the cut falls where it does, so
|
|
113
|
+
a planner reading one ticket knows what its siblings own.
|
|
114
|
+
|
|
115
|
+
### Keep the blocker graph wide
|
|
116
|
+
|
|
117
|
+
A split feature takes as long as its longest blocker chain, not as long as
|
|
118
|
+
its ticket count. A wave of independent tickets finishes in about one build's
|
|
119
|
+
time; the same tickets in a chain take one build per link. Prefer cuts that
|
|
120
|
+
let tickets start together. When one ticket must land first — usually the one
|
|
121
|
+
that establishes a shared contract — keep it to that contract and its tests,
|
|
122
|
+
so the wave behind it starts sooner, and fold nothing unrelated into it.
|
|
123
|
+
Add a blocker only for a real prerequisite, never to express a preferred
|
|
124
|
+
order.
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
57
128
|
## Immutability during a build
|
|
58
129
|
|
|
59
130
|
The spec is the build's contract artifact (kind `spec`, revision 0). It
|
|
@@ -4,8 +4,9 @@ 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
5
|
forge. File and hosted sources support import. Linear supports export only.
|
|
6
6
|
|
|
7
|
-
1. Pause intake and
|
|
8
|
-
|
|
7
|
+
1. Pause intake and quiesce build-related ticket writes and other ticket writers
|
|
8
|
+
for the cutover. In-flight builds need not be aborted. Import preflight does
|
|
9
|
+
not reserve numbers against concurrent writers.
|
|
9
10
|
2. With the old `[tickets]` configuration, run `ab ticket export /path/to/export`.
|
|
10
11
|
The destination must be absent or empty. Export reads every state, including
|
|
11
12
|
archived Linear tickets and empty discoverable states, and publishes the
|
|
@@ -14,8 +15,20 @@ forge. File and hosted sources support import. Linear supports export only.
|
|
|
14
15
|
hosted ticket service. Keep the export directory intact.
|
|
15
16
|
4. Run `ab ticket import /path/to/export`. Inspect its printed ticket and state
|
|
16
17
|
mappings and `/path/to/export/.ab-import-map.json`.
|
|
17
|
-
5.
|
|
18
|
-
|
|
18
|
+
5. Import records a durable source/ID mapping in the same BuildStore and repository
|
|
19
|
+
that hold the existing builds, after tickets, metadata and assets finish.
|
|
20
|
+
Keep that BuildStore/repository identity through the cutover.
|
|
21
|
+
6. Inspect ticket bodies, labels, blockers, comments and attachments in the new
|
|
22
|
+
source. Confirm lifecycle configuration and the ready gate, then resume builds and intake.
|
|
23
|
+
|
|
24
|
+
Linear export reads full ticket details in batches and prints `read X/Y tickets`.
|
|
25
|
+
The total is shown as pending until inventory discovery finishes. If Linear reports
|
|
26
|
+
a rate limit with a usable future reset time, export prints the wait time, waits
|
|
27
|
+
until that reset, and retries the failed read while retaining completed pages.
|
|
28
|
+
Without a usable reset time, export fails immediately. A running dispatcher and
|
|
29
|
+
other clients authenticated as the same API user share the API budget, so they
|
|
30
|
+
can cause additional waits. Interrupting export with Ctrl-C publishes nothing;
|
|
31
|
+
the destination stays absent or empty until all ticket and attachment reads succeed.
|
|
19
32
|
|
|
20
33
|
Both commands also accept
|
|
21
34
|
`--store <ref>` to reach legacy BuildStore attachments. Keep the old store available
|
|
@@ -70,3 +83,36 @@ identity, establishes node kinds, then applies targets using the durable id map,
|
|
|
70
83
|
just like blockers. Input order does not matter. Resuming also restores edges on
|
|
71
84
|
adopted tickets; normal destination validation still guards existing graphs and
|
|
72
85
|
node demotion. Older work-only exports remain valid.
|
|
86
|
+
|
|
87
|
+
## In-flight builds
|
|
88
|
+
|
|
89
|
+
A recorded migration resolves old source-qualified ticket references through the
|
|
90
|
+
new source, including remapped IDs. Completeness, child targeting, capacity
|
|
91
|
+
ancestry, claimed target checks, lifecycle transitions and notices use that
|
|
92
|
+
mapping. Historical build events and ticket references remain unchanged. Moves
|
|
93
|
+
can chain across sources; mappings are never applied backward. A source switch
|
|
94
|
+
alone establishes no continuity. Missing migration evidence or an uncovered ID
|
|
95
|
+
fails closed and names the build and original ticket when operating on that
|
|
96
|
+
build or its frozen membership. Uncovered historical builds stay in their
|
|
97
|
+
original namespace during history searches; they cannot alias current tickets
|
|
98
|
+
or block unrelated intake. Separate trackers with the
|
|
99
|
+
same adapter name cannot be distinguished by historical references; this does
|
|
100
|
+
not establish continuity between them.
|
|
101
|
+
|
|
102
|
+
When using the export directory directly as the configured file tracker, run
|
|
103
|
+
`ab ticket migration record /path/to/export [--store <ref>]`. This verifies the
|
|
104
|
+
manifest inventory and creation keys against the destination and records identity
|
|
105
|
+
mappings for the original manifest IDs, without importing tickets. Additional
|
|
106
|
+
tickets filed in the directory after export are allowed and are not included in
|
|
107
|
+
the mapping. Every original ID must still exist with its recorded creation key.
|
|
108
|
+
Preserve `.ab-migration.json` for this step;
|
|
109
|
+
the tracker itself can operate without it. `.ab-import-map.json` is progress
|
|
110
|
+
information, never proof of continuity. Repeating an identical recording is safe;
|
|
111
|
+
conflicting evidence is refused.
|
|
112
|
+
|
|
113
|
+
Import is not transactional across ticket and build services. A partial import
|
|
114
|
+
records no continuity; rerun with the same directory to adopt by creation key.
|
|
115
|
+
If tickets finish but journal recording fails, the command reports that boundary:
|
|
116
|
+
rerun the same command to finish recording before resuming builds. The migration
|
|
117
|
+
journal belongs to the selected BuildStore even when ticket assets live on an
|
|
118
|
+
independent hosted service. Validate the destination configuration before resume.
|
package/skills/spec/SKILL.md
CHANGED
|
@@ -8,7 +8,8 @@ description: Design a feature spec-first through conversation, or flesh out an e
|
|
|
8
8
|
The conversational surface over the complete
|
|
9
9
|
[spec standard](../ab-guide/references/spec-standard.md) installed with
|
|
10
10
|
`ab-guide` — read it first. It defines "buildable": what and why but never how,
|
|
11
|
-
verifiable acceptance criteria, explicit out-of-scope, and evidence
|
|
11
|
+
verifiable acceptance criteria, explicit out-of-scope, and evidence, plus how
|
|
12
|
+
to size work and where to split it. This skill
|
|
12
13
|
runs *before* a build exists, so it takes a ticket, not a build slug — and
|
|
13
14
|
unlike the phase skills, it is a conversation with a human, not an autonomous
|
|
14
15
|
session.
|
|
@@ -31,9 +32,12 @@ ab ticket show <id> --json
|
|
|
31
32
|
ab ticket tree --json
|
|
32
33
|
```
|
|
33
34
|
|
|
34
|
-
Whenever grooming produces more than one ticket for a feature,
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
Whenever grooming produces more than one ticket for a feature, first confirm
|
|
36
|
+
the split is warranted under the standard's
|
|
37
|
+
[sizing and splitting](../ab-guide/references/spec-standard.md#sizing-and-splitting)
|
|
38
|
+
guidance, then explicitly choose root or a node before filing,
|
|
39
|
+
including when fleshing out an existing ticket splits it into several tickets.
|
|
40
|
+
Consult the shared destination criteria and read
|
|
37
41
|
the repository's effective landing policy in `autobuild.toml`; explain the actual
|
|
38
42
|
landing and consent flow to the human in plain terms. Ask the human when the
|
|
39
43
|
choice is unclear from grooming. Root is valid when each ticket can ship alone.
|
|
@@ -61,6 +65,11 @@ in order, but as a conversation, not a form:
|
|
|
61
65
|
conversation in what actually exists.
|
|
62
66
|
2. **Acceptance criteria.** Propose them yourself from the discussion; let
|
|
63
67
|
the user correct. Each must be checkable by a reviewer or a verify step.
|
|
68
|
+
If the criteria fall into separate groups, apply
|
|
69
|
+
[sizing and splitting](../ab-guide/references/spec-standard.md#sizing-and-splitting)
|
|
70
|
+
before treating the work as several tickets: default to one larger ticket,
|
|
71
|
+
and when a split is warranted, propose the seams and the blocker graph to
|
|
72
|
+
the user with the reason for each cut.
|
|
64
73
|
3. **Out of scope.** Ask what adjacent work is explicitly excluded. Propose
|
|
65
74
|
candidates — the tempting expansions you noticed while reading the code.
|
|
66
75
|
4. **Evidence.** Link what exists: the error rates, the user reports, the
|
|
@@ -231,6 +240,9 @@ repository, report that rather than waiting on builds that cannot start.
|
|
|
231
240
|
|
|
232
241
|
## Rules
|
|
233
242
|
|
|
243
|
+
- **Fewer, larger tickets.** Split only when sizing calls for it, cut at
|
|
244
|
+
seams, and keep the blocker graph wide so independent tickets build
|
|
245
|
+
together.
|
|
234
246
|
- The spec says **what and why, never how.** An exported, attached `design`
|
|
235
247
|
asset is a contract on observable visual and reference outcomes — layout,
|
|
236
248
|
content, states, copy, look — that plan, review, and verify judge against;
|