@defrex/autobuild 0.14.0 → 1.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. package/README.md +13 -6
  2. package/SPEC.md +657 -100
  3. package/docs/architecture.md +230 -5
  4. package/docs/assets/headline-wide.png +0 -0
  5. package/docs/configuration.md +118 -14
  6. package/docs/hosted-service.md +18 -0
  7. package/docs/integration-tree.md +117 -0
  8. package/docs/landing-policy.md +150 -0
  9. package/docs/mcp.md +24 -0
  10. package/docs/migration-1.0.md +68 -0
  11. package/docs/operator-api.md +19 -8
  12. package/docs/remote-store-protocol.md +30 -7
  13. package/docs/remote-ticket-protocol.md +26 -5
  14. package/docs/restacking.md +79 -0
  15. package/docs/setup.md +53 -6
  16. package/docs/ticket-dependencies.md +69 -0
  17. package/docs/ticket-migration.md +8 -0
  18. package/package.json +3 -3
  19. package/packages/core/src/cli/attention.ts +25 -2
  20. package/packages/core/src/cli/build-control.ts +65 -41
  21. package/packages/core/src/cli/context.ts +54 -2
  22. package/packages/core/src/cli/dashboard/actions.ts +6 -3
  23. package/packages/core/src/cli/dashboard/landing-display.ts +6 -0
  24. package/packages/core/src/cli/dashboard/live.ts +5 -0
  25. package/packages/core/src/cli/dashboard/model.ts +142 -18
  26. package/packages/core/src/cli/dashboard/poll.ts +15 -9
  27. package/packages/core/src/cli/dashboard/refresh.ts +183 -0
  28. package/packages/core/src/cli/dashboard/render.ts +78 -28
  29. package/packages/core/src/cli/dashboard/repository-poll.ts +57 -0
  30. package/packages/core/src/cli/dashboard/selection.ts +7 -1
  31. package/packages/core/src/cli/dashboard/tree.ts +107 -0
  32. package/packages/core/src/cli/dispatch-frontend.ts +156 -105
  33. package/packages/core/src/cli/dispatch.ts +257 -139
  34. package/packages/core/src/cli/dispatcher-liveness.ts +15 -2
  35. package/packages/core/src/cli/help.ts +52 -33
  36. package/packages/core/src/cli/init-validation.ts +43 -2
  37. package/packages/core/src/cli/keyboard.ts +6 -0
  38. package/packages/core/src/cli/landings.ts +18 -0
  39. package/packages/core/src/cli/main.ts +49 -15
  40. package/packages/core/src/cli/mcp.ts +9 -0
  41. package/packages/core/src/cli/publication-settlement.ts +168 -2
  42. package/packages/core/src/cli/repository-status.ts +11 -0
  43. package/packages/core/src/cli/status.ts +72 -5
  44. package/packages/core/src/cli/terminal-restore.ts +54 -0
  45. package/packages/core/src/cli/terminal.ts +16 -2
  46. package/packages/core/src/cli/terminals.ts +98 -79
  47. package/packages/core/src/cli/ticket-editor.ts +10 -3
  48. package/packages/core/src/cli/ticket.ts +113 -18
  49. package/packages/core/src/cli/upgrade-commit.ts +4 -0
  50. package/packages/core/src/cli/upgrade-compatibility.ts +2 -2
  51. package/packages/core/src/cli/upgrade-landing.ts +69 -0
  52. package/packages/core/src/cli/upgrade.ts +16 -0
  53. package/packages/core/src/cli/wait.ts +115 -19
  54. package/packages/core/src/cli/watch.ts +51 -12
  55. package/packages/core/src/config/landing.ts +22 -0
  56. package/packages/core/src/config/live.ts +1 -0
  57. package/packages/core/src/config/schema.ts +3 -0
  58. package/packages/core/src/events/catalog.ts +48 -3
  59. package/packages/core/src/events/payloads.ts +295 -6
  60. package/packages/core/src/events/repository.ts +31 -0
  61. package/packages/core/src/integration/harness.ts +10 -0
  62. package/packages/core/src/kernel/__snapshots__/reducer-registry.test.ts.snap +1030 -239
  63. package/packages/core/src/kernel/auto-merge-default.ts +1 -0
  64. package/packages/core/src/kernel/auto-merge.ts +12 -3
  65. package/packages/core/src/kernel/build-identity.ts +94 -0
  66. package/packages/core/src/kernel/change-presence.ts +179 -0
  67. package/packages/core/src/kernel/dispatch-status.ts +17 -1
  68. package/packages/core/src/kernel/engine.ts +89 -2
  69. package/packages/core/src/kernel/generators/build-log.ts +23 -0
  70. package/packages/core/src/kernel/generators/leaf-restack-log.ts +110 -0
  71. package/packages/core/src/kernel/generators/node-restack-log.ts +94 -0
  72. package/packages/core/src/kernel/generators/repository-journals.ts +11 -0
  73. package/packages/core/src/kernel/integration-completeness.ts +81 -0
  74. package/packages/core/src/kernel/integration-landing.ts +263 -0
  75. package/packages/core/src/kernel/integration-stack.ts +36 -0
  76. package/packages/core/src/kernel/integration-state.ts +135 -0
  77. package/packages/core/src/kernel/landing-policy.ts +47 -0
  78. package/packages/core/src/kernel/landing-publication.ts +41 -0
  79. package/packages/core/src/kernel/landing-readiness.ts +67 -0
  80. package/packages/core/src/kernel/landing-state.ts +96 -0
  81. package/packages/core/src/kernel/leaf-restack-completion.ts +24 -0
  82. package/packages/core/src/kernel/leaf-restack-state.ts +73 -0
  83. package/packages/core/src/kernel/log-index.ts +35 -5
  84. package/packages/core/src/kernel/node-landing.ts +439 -0
  85. package/packages/core/src/kernel/node-parent.ts +184 -0
  86. package/packages/core/src/kernel/node-restack-state.ts +191 -0
  87. package/packages/core/src/kernel/node-restack-transaction.ts +210 -0
  88. package/packages/core/src/kernel/node-restack.ts +274 -0
  89. package/packages/core/src/kernel/read-facts.ts +70 -3
  90. package/packages/core/src/kernel/reconcile-head.ts +51 -0
  91. package/packages/core/src/kernel/reconcile-restack.ts +560 -0
  92. package/packages/core/src/kernel/reducer-registry.ts +16 -0
  93. package/packages/core/src/kernel/reducer.ts +121 -6
  94. package/packages/core/src/kernel/snapshot-parent.ts +33 -0
  95. package/packages/core/src/ontology.ts +9 -1
  96. package/packages/core/src/operator/annotations.ts +12 -0
  97. package/packages/core/src/operator/control.ts +6 -0
  98. package/packages/core/src/operator/index.ts +4 -0
  99. package/packages/core/src/operator/landings.ts +35 -0
  100. package/packages/core/src/operator/presentation.ts +1 -0
  101. package/packages/core/src/operator/protocol.ts +12 -3
  102. package/packages/core/src/operator/query.ts +3 -1
  103. package/packages/core/src/operator/registry.ts +48 -19
  104. package/packages/core/src/operator/requests.ts +1 -8
  105. package/packages/core/src/operator/tickets.ts +55 -9
  106. package/packages/core/src/plugins/load.ts +3 -4
  107. package/packages/core/src/ports/forge/contract.ts +91 -3
  108. package/packages/core/src/ports/forge/fake.ts +142 -4
  109. package/packages/core/src/ports/forge/git-rewrite.ts +232 -0
  110. package/packages/core/src/ports/forge/github-readiness.ts +421 -0
  111. package/packages/core/src/ports/forge/github.ts +631 -35
  112. package/packages/core/src/ports/forge/local-git.ts +119 -5
  113. package/packages/core/src/ports/forge/readiness.ts +99 -0
  114. package/packages/core/src/ports/tickets/contract.ts +41 -0
  115. package/packages/core/src/ports/tickets/create.ts +8 -1
  116. package/packages/core/src/ports/tickets/fake.ts +32 -1
  117. package/packages/core/src/ports/tickets/file-codec.ts +7 -0
  118. package/packages/core/src/ports/tickets/file.ts +18 -1
  119. package/packages/core/src/ports/tickets/hosted-index.ts +2 -0
  120. package/packages/core/src/ports/tickets/linear.ts +124 -4
  121. package/packages/core/src/ports/tickets/migration.ts +25 -1
  122. package/packages/core/src/ports/tickets/operations.ts +7 -2
  123. package/packages/core/src/ports/tickets/remote-protocol.ts +19 -0
  124. package/packages/core/src/ports/tickets/remote.ts +10 -1
  125. package/packages/core/src/ports/tickets/revision.ts +3 -1
  126. package/packages/core/src/ports/tickets/tree.ts +148 -0
  127. package/packages/core/src/ports/tickets/update.ts +15 -2
  128. package/packages/core/src/ports/types.ts +135 -5
  129. package/packages/core/src/ports/workspace/git-worktree.ts +2 -1
  130. package/packages/core/src/ports/workspace/provider-capabilities.ts +1 -1
  131. package/packages/core/src/ports/workspace/vercel-sandbox.ts +60 -3
  132. package/packages/core/src/processes/build-runner.ts +530 -23
  133. package/packages/core/src/processes/dispatcher-selectors.ts +15 -9
  134. package/packages/core/src/processes/dispatcher.ts +2145 -203
  135. package/packages/core/src/processes/execution-no-progress.ts +46 -1
  136. package/packages/core/src/processes/publication-state.ts +30 -5
  137. package/packages/core/src/processes/repo-view.ts +21 -2
  138. package/packages/core/src/store/build-scope.ts +18 -0
  139. package/packages/core/src/store/contract.ts +658 -0
  140. package/packages/core/src/store/digest.ts +52 -4
  141. package/packages/core/src/store/local/schema.ts +25 -13
  142. package/packages/core/src/store/local/store.ts +117 -1
  143. package/packages/core/src/store/memory.ts +62 -1
  144. package/packages/core/src/store/phase-session.ts +17 -0
  145. package/packages/core/src/store/reduced-reads.ts +2 -1
  146. package/packages/core/src/store/reducer-value-shapes.json +10707 -6440
  147. package/packages/core/src/store/remote/client.ts +45 -0
  148. package/packages/core/src/store/remote/compatibility.ts +25 -9
  149. package/packages/core/src/store/remote/protocol.ts +11 -0
  150. package/packages/core/src/store/repo-state-events.ts +2 -0
  151. package/packages/core/src/store/session-handle.ts +15 -0
  152. package/packages/core/src/store/subscribe.ts +1 -1
  153. package/packages/core/src/store/types.ts +34 -4
  154. package/packages/core/src/testing/index.ts +2 -0
  155. package/packages/core/src/testing/reduced-read-budget.ts +48 -8
  156. package/packages/core/src/testing/refresh-scheduler.ts +32 -0
  157. package/skills/guide/SKILL.md +117 -64
  158. package/skills/guide/references/integration-tree.md +117 -0
  159. package/skills/guide/references/landing-policy.md +150 -0
  160. package/skills/guide/references/migration-1.0.md +68 -0
  161. package/skills/guide/references/operator-api.md +12 -5
  162. package/skills/guide/references/plugin-authoring.md +42 -3
  163. package/skills/guide/references/remote-store-protocol.md +30 -7
  164. package/skills/guide/references/remote-ticket-protocol.md +26 -5
  165. package/skills/guide/references/restacking.md +79 -0
  166. package/skills/guide/references/setup.md +53 -6
  167. package/skills/guide/references/ticket-dependencies.md +69 -0
  168. package/skills/guide/references/ticket-migration.md +8 -0
  169. package/skills/operate/SKILL.md +55 -5
  170. package/skills/reconcile/SKILL.md +55 -48
  171. package/skills/spec/SKILL.md +67 -1
  172. package/skills/tickets/SKILL.md +55 -2
  173. package/templates/autobuild.toml +3 -0
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: operate
3
- description: Orchestrate a repository's builds - file and groom tickets, watch builds, answer escalations, pause, resume, or abort builds, control auto-merge, and drive work to merge. Use when asked to watch, shepherd, or orchestrate builds, whether from a coding-agent session at the repository root using the ab CLI or inside the hosted service with the operator tool registry.
3
+ description: Orchestrate a repository's builds - file and groom tickets, watch builds, answer escalations, pause, resume, or abort builds, control landing consent, and drive work to merge. Use when asked to watch, shepherd, or orchestrate builds, whether from a coding-agent session at the repository root using the ab CLI or inside the hosted service with the operator tool registry.
4
4
  ---
5
5
 
6
6
  # Operating the repository
@@ -10,7 +10,9 @@ pointed at a repository to file tickets, watch builds, unblock them, answer
10
10
  operator questions, and drive work to merge. Any agent can take it on: a
11
11
  coding-agent session at the repository root using the `ab` CLI (or `ab mcp`),
12
12
  or the hosted service's embedded turn runner. There is no initialization
13
- step — deciding to orchestrate is enough.
13
+ step — deciding to orchestrate is enough. By default, the agent that
14
+ specified and queued work (the `ab-spec` and `ab-tickets` skills) takes the
15
+ role for that work as soon as it is ready, unless the human opts out.
14
16
 
15
17
  The orchestrator is not a build phase: it never runs pipeline steps, never
16
18
  edits the repository, and never touches a build's checkout. Its reach is the
@@ -211,7 +213,15 @@ Read events with a cursor or a small `--events` count; logs are long.
211
213
  hold and release the whole repository.
212
214
  - `ab abort <slug>` — destructive: closes the PR, removes branches, and
213
215
  returns the ticket to triage.
214
- - `ab auto-merge <slug> on|off` — request or cancel native auto-merge.
216
+ - `ab hold <slug>` — persistently hold a landing and revoke earlier consent.
217
+ - `ab land <slug>` — consent to a ready landing and clear its hold. Consent
218
+ survives restacks and verification; use hold to withdraw it when work changes.
219
+ Read the matched policy, readiness, acknowledged command and gate deferral in
220
+ build status before acting. Work the consent queue by checking completeness
221
+ and current verification, then issuing land for the chosen landing. A land
222
+ acknowledgement accepts consent; it never promises that gates passed.
223
+ - Configure ordered `[[landing]]` rules for project policy through ab-guide.
224
+ Repository auto-merge defaults and per-build auto-merge toggles are retired.
215
225
 
216
226
  ### Tickets
217
227
 
@@ -317,8 +327,11 @@ Treat every default-watch record as a call to act:
317
327
 
318
328
  - `escalation.raised`: inspect the question and evidence, then resolve it using
319
329
  the shared rules.
320
- - `build.merge-decision`: inspect the PR and current merge gate, then apply
321
- the operator's merge policy or request the decision that is missing.
330
+ - `build.consent-ready`: inspect the one consent queue, then land or hold the
331
+ selected candidate under the operator's policy. Unready or stale candidates
332
+ do not produce this observation.
333
+ - `build.merge-decision`: diagnose the current merge-gate deferral or unsafe
334
+ forge outcome. Consent and hold decisions use only `build.consent-ready`.
322
335
  - Harvest escalation or recovery exhaustion: inspect harvest status and resolve
323
336
  the reported blocker.
324
337
  - Dispatcher loss, abnormal stop, restart-required reload, rejected config, or
@@ -376,3 +389,40 @@ for the exceptions above.
376
389
  and a message that arrives mid-turn is answered after the current turn ends.
377
390
  - Where operator notes exist (hosted), they are shared ground truth; keep
378
391
  them current when you learn something durable.
392
+
393
+ ## Drive the tree through one consent queue
394
+
395
+ The root is the configured base branch. A node is a named integration point;
396
+ its integration build collects child contributions on its recorded branch.
397
+ A target is the destination of a contribution. `ab ticket tree --json` (MCP
398
+ `tickets.tree`) shows exhaustive source metadata, including completed tickets
399
+ and empty nodes. A claimed build freezes its effective target; use build status
400
+ or queue entries for landing ancestry after a source ticket changes.
401
+
402
+ Start with `ab landings --json` (MCP `landings.list`). This is the one queue of
403
+ ready landings needing a decision: consent-policy candidates and held ready
404
+ candidates. Entries include the target, branch preview, candidate head/parent,
405
+ verification receipts and node children/completeness. Unknown completeness is
406
+ not zero children. A changed head or parent must regain current verification;
407
+ unfinished or automatically authorized candidates do not ask for attention.
408
+
409
+ Select a queue build in the terminal and use `l land` or `o hold`, or run
410
+ `ab land <slug>` / `ab hold <slug>`. MCP uses `builds.control` with action `land`
411
+ or `hold`. Hold is available before readiness and suppresses automatic landing.
412
+ Land rechecks readiness and live node completeness, so act on failures by
413
+ refreshing the facts. Open children keep a node collecting. When integration
414
+ verification fails, file a repair child targeting that node and let it land
415
+ before retrying the node cycle.
416
+
417
+ Watch for decisions and conflicts with `ab watch --json`; save its opaque cursor
418
+ and resume with `ab watch --since <cursor> --json`. Default attention includes
419
+ node landings, node item conflicts, conflicted leaf replays and derived
420
+ `build.consent-ready` observations, including already-ready landings on first
421
+ repository-wide discovery. Readiness is identified by its durable
422
+ entry position: resuming suppresses the same episode, while a new candidate or
423
+ exit/re-entry can notify again. Explicit `--event` globs remain event-only.
424
+ Use `ab wait --for consent --for node-landed --for restack-conflicted --json`
425
+ for one wake; state waits return immediately when already satisfied. `--for
426
+ attention` also includes consent readiness and landing/conflict attention.
427
+ Resume event backlogs with `--since <cursor>`; keep handling emitted records
428
+ before interpreting terminal completion.
@@ -1,65 +1,72 @@
1
1
  ---
2
2
  name: reconcile
3
- description: Resolve a conflicted PR by merging base into the build branch. Invoked by the build-runner as the reconcile phase; takes only the build slug.
3
+ description: Resolve the kernel-prepared replay of a build's single change onto its refreshed base. Invoked by the build-runner as the reconcile phase; takes only the build slug.
4
4
  ---
5
5
 
6
6
  # /ab-reconcile <build>
7
7
 
8
- The build's PR no longer merges cleanly: main moved. Your job is one merge
9
- commit — base merged *into* the build branch — that preserves both what this
10
- build was for and what landed on main since. **Never rebase**: rebasing
11
- re-resolves conflicts against a moving target and severs recorded SHA
12
- provenance, so it is banned in this system.
8
+ The kernel has collapsed this build's contribution into one change and replayed
9
+ it onto a frozen refreshed base. Your job is to preserve both the build's intent
10
+ and the behavior already landed upstream. Work on the prepared detached HEAD;
11
+ the kernel retains the published branch until guarded publication succeeds.
12
+
13
+ For a node conflict, `nodeChange` names the integration owner, transaction,
14
+ current item, source SHA and optional source build. The prepared replay is only
15
+ that change, not the whole node. The materialized spec, plan and implement-notes
16
+ belong to the source build. For a foreign item, inspect `foreign-change.patch`
17
+ and preserve foreign status without adding an identity; escalate if its intent
18
+ cannot be established. Missing source context requires escalation. The replay
19
+ base is `conflict.baseSha`; preserve the source build's trailer rather than the
20
+ integration owner's. `ab done` retains the item and records its receipt; trusted
21
+ kernel plumbing advances the remaining stack after the session ends. Do not
22
+ publish, collapse the node, choose another item, or rewrite the public branch.
13
23
 
14
24
  ## Session shape
15
25
 
16
- 1. Run `ab context`. Read the manifest path printed by the command (normally
17
- `.ab/context.json`) and use its `materialized` paths for the spec, plan, and
18
- implement notes; legacy tracked paths may relocate them. It also contains
19
- conflict info (`baseSha`) and — when a human answered an escalation a previous
20
- attempt raised — `.ab/guidance.json`, their answer to it. Kernel plumbing
21
- fetched the PR's configured base and resolved this SHA immediately before
22
- your session, so the commit already exists locally; it is not the older
23
- conflict-detection snapshot.
24
- 2. `git merge <baseSha>` in the workspace and resolve every conflict with
25
- the explicit charge to **regress against neither side**:
26
- - The spec and plan tell you what this branch's changes are *for* — a
27
- resolution that quietly drops the behavior they describe is a failed
28
- reconcile, even if it compiles.
29
- - The incoming base commits are already merged reality — a resolution
30
- that undoes them will break main.
31
- 3. Textual conflicts with one faithful resolution: resolve them. Then run
32
- the repo's checks (typecheck, tests) — a merge that compiles but fails
33
- tests is not resolved.
34
- 4. Write the manifest's `notesPath` (normally `.ab/reconcile-notes.md`) with
35
- each conflicted file, what collided, and why the resolution preserves both
36
- sides; then run `ab done --notes <notesPath>`. The notes bytes reach the
37
- store only through this flag; the file is never committed.
26
+ 1. Run `ab context`. Read the printed manifest and its `materialized` paths for
27
+ the spec, approved plan, implement-notes, and any `.ab/guidance.json` guidance. `replay` names the
28
+ original head, old contribution base, single change, frozen target base and
29
+ whether replay conflicted. A replay may originate at verify entry before any
30
+ PR exists; `restackId` identifies an adopted automatic transaction. Never fetch, merge, rebase, select another base,
31
+ or move the named branch yourself. Missing replay inputs require escalation, except a node item uses `nodeChange` and `conflict.baseSha` instead of `replay`.
32
+ 2. Inspect `git status` and the prepared replay. If conflicts remain, resolve
33
+ them with the explicit charge to regress against neither side:
34
+ - Preserve the behavior the spec and approved plan require.
35
+ - Preserve the behavior already landed on the target base.
36
+ Stage only the resolved files and run `git cherry-pick --continue`. If the
37
+ change is now redundant, preserve an empty commit with `git commit
38
+ --allow-empty --no-edit`; never skip away the build's identity. A clean
39
+ replay already has its commit and still needs inspection and checks.
40
+ 3. Run the repository's required checks. The result must be exactly one commit
41
+ with exactly one parent equal to `replay.targetBase` (or `conflict.baseSha` for a
42
+ node item) and exactly one terminal
43
+ `Autobuild-Build: <build>` trailer. For node items use the source identity in
44
+ `nodeChange.build`; a foreign item must have no build trailer. Do not create a merge commit.
45
+ 4. Write the manifest's `notesPath`: what collided, how each resolution preserves
46
+ both sides, and the checks run. Never commit notes or any other `.ab/` path.
47
+ Legacy tracked scratch may be inherited unchanged from either input; do not
48
+ author scratch changes as part of resolution.
49
+ 5. Run `ab done --notes <notesPath>`. The kernel validates, archives recorded
50
+ evidence, and publishes with an exact expected-head lease. If the branch
51
+ changed, it prepares another replay of the observed complete contribution
52
+ onto the same frozen base. Read context again, inspect and resolve that replay,
53
+ run checks, update notes, then retry completion. Never push yourself.
38
54
 
39
- `ab done` requires the merge commit to exist and the worktree to be
40
- clean; the push is plumbing. Verification re-runs in full afterward
41
- because reconciliation changed code — that is expected, not a failure.
55
+ A publication success message parks this turn for kernel publication;
56
+ do not repeat `ab done` after success. Post-reconcile verification follows the
57
+ captured policy and begins a fresh cycle after confirmed publication. A conflict
58
+ at initial verify entry still requires initial checks regardless of that policy.
42
59
 
43
60
  ## When not to resolve
44
61
 
45
- A **semantic** conflict — both sides changed the same behavior's meaning,
46
- the resolution needs a decision the spec doesn't make, or preserving both
47
- sides is impossible — escalates rather than guesses:
62
+ Escalate semantic conflicts, incompatible or deleted branch history, or choices
63
+ that the spec does not settle. Do not guess away either side's behavior:
48
64
 
49
65
  ```
50
- ab escalate "main's abc123 changed the session-token format; this build's rate limiter keys on the old format. Adopt the new format (touches spec criterion 3) or key differently?" --refs src/auth.ts
66
+ ab escalate "The target changes the session-token format but the build keys its limiter on the old format. Which behavior should the limiter adopt?" --refs src/auth.ts
51
67
  ```
52
68
 
53
- When an earlier attempt escalated and a human answered, `.ab/guidance.json`
54
- carries the escalation id and their answer. It is authoritative feedback for
55
- this attempt — resolve the way it says — while the spec remains the contract
56
- this phase is measured against; if the two cannot both be satisfied, escalate
57
- again rather than guess. Reconcile has no review round, so guidance is the only
58
- feedback it ever receives.
59
-
60
- Never stage or commit anything under `.ab/`, including with `git add -f`.
61
- Tracked legacy scratch needs no index flags or stash: leave it untouched and
62
- let the normal merge inherit, update, or delete it from a parent.
63
-
64
- A wrong guess here lands directly on main. Exactly one terminal command:
65
- `ab done` or `ab escalate`.
69
+ A human answer in guidance is authoritative while the spec remains the contract.
70
+ If they cannot both be satisfied, escalate the contradiction. Reconcile has no
71
+ code-review round; risky resolutions need human judgment. The only successful
72
+ terminal commands are `ab done` and `ab escalate`.
@@ -13,6 +13,41 @@ runs *before* a build exists, so it takes a ticket, not a build slug — and
13
13
  unlike the phase skills, it is a conversation with a human, not an autonomous
14
14
  session.
15
15
 
16
+ ## Node tickets and targets
17
+
18
+ Tickets have `kind = "work"` by default, or `kind = "node"` for a named
19
+ integration point. The optional `target` is a node ticket id in the same source;
20
+ omission means the configured `baseBranch` root. Nodes may target other nodes.
21
+ These fields currently describe intent only: dispatch, branches and landing
22
+ behavior are unchanged in this increment. Blockers remain a separate graph.
23
+
24
+ Use `ab ticket create "Integration" --body spec.md --kind node`, then
25
+ `ab ticket update <id> --target <node-id>`. Clear a target with `--no-target`;
26
+ reset kind with `--kind work`. Omitted fields preserve existing values.
27
+ `ab ticket show <id> [--json]` exposes both fields; `ab ticket tree [--json]`
28
+ shows the configured root and every ticket, including completed work and empty
29
+ nodes, nested by target with state. Siblings are sorted by id. Invalid external
30
+ graphs and listing diagnostics are reported explicitly.
31
+
32
+ Targets must exist and be nodes in the configured source. Self-targeting,
33
+ ancestor cycles and demoting a node with targeting tickets are refused before
34
+ any part of the requested update is written, regardless of ticket state.
35
+ Clear or reparent its children before demotion. File frontmatter persists the
36
+ fields; `ab ticket edit` displays them read-only. Change them through update.
37
+ Kind and target participate in content revisions and revision-checked writes.
38
+ File writes retain their existing best-effort, unlocked concurrency semantics.
39
+
40
+ Linear uses the exact `node` issue label for kind and the parent relation for
41
+ target, only when the parent carries that label. Ordinary grouping parents do
42
+ not impose targets and survive unrelated updates. Explicit target clear clears
43
+ the parent relation. Label replacements can demote nodes and receive the same
44
+ guards; explicit kind and label instructions must agree about `node`. Label
45
+ and parent connections are fully paginated. Linear still refuses guarded writes.
46
+
47
+ Hosted sources and legacy plugins read as work with no target and refuse any
48
+ explicit metadata write, including clears and mixed patches, with guidance to
49
+ use a capable source. No hosted storage or protocol change is implied.
50
+
16
51
  ## Ticket operations
17
52
 
18
53
  Reach for `ab` first and use it whenever its CLI supports the requested ticket
@@ -57,7 +92,8 @@ setting is absent.
57
92
  When the explicitly named destination equals `[tickets].readyState`, tell the
58
93
  human in the completion response that the ticket may be claimed by the next
59
94
  dispatch once the repository's label, dependency, intake, capacity, and other
60
- readiness gates are satisfied.
95
+ readiness gates are satisfied, and that you will operate it from there (see
96
+ [After filing: operate what you queued](#after-filing-operate-what-you-queued)).
61
97
 
62
98
  If grooming established prerequisites, follow the complete
63
99
  [safe blocker-filing workflow](../ab-guide/references/ticket-dependencies.md).
@@ -153,6 +189,36 @@ files over the store's size limit), keep the external link in Evidence and say
153
189
  plainly, in the spec and to the human, that builds cannot read it, so the
154
190
  planner does not treat it as a contract.
155
191
 
192
+ ## After filing: operate what you queued
193
+
194
+ Once work you specified sits in the ready state, its builds start without
195
+ anyone watching them. By default, the agent that wrote the spec becomes their
196
+ operator. You hold the context an escalation asks about — the intent, the
197
+ alternatives the human rejected, what was ruled out of scope — and a build
198
+ blocked on a question you could answer should not wait for a human.
199
+
200
+ So when this conversation leaves work in the ready state, say in the
201
+ completion response that you will shepherd it, then load the `ab-operate`
202
+ skill and follow it: arm the standing watch, reconcile status, resolve
203
+ attention, and report each outcome until every build you queued has merged or
204
+ otherwise ended. Shepherd what this conversation queued unless the human
205
+ widens the scope.
206
+
207
+ This is the default, not a requirement:
208
+
209
+ - If the human says they will operate the work themselves, or hands it to
210
+ another agent, file the tickets and stop. A standing preference to the same
211
+ effect in the repository's agent instructions wins too.
212
+ - If the work is not in the ready state, for example left in triage for later
213
+ grooming, there is nothing to shepherd yet. Offer to operate once it is
214
+ ready; do not start a watch.
215
+ - If this session cannot keep a long-running watch (no background or monitor
216
+ facility, or no operator surface), say so and leave operation to the human.
217
+
218
+ Operating follows the `ab-operate` skill's rules, including its boundaries:
219
+ never start, stop, or restart a dispatcher. If no dispatcher holds the
220
+ repository, report that rather than waiting on builds that cannot start.
221
+
156
222
  ## Rules
157
223
 
158
224
  - The spec says **what and why, never how.** An exported, attached `design`
@@ -9,6 +9,52 @@ The local ticket tracker is a directory of markdown files. `ls` and `mv` are
9
9
  the state/backlog UI; source-agnostic `ab ticket` commands create and edit
10
10
  content and blocker relationships. The default file source needs no secret.
11
11
 
12
+ ## Node tickets and targets
13
+
14
+ Tickets have `kind = "work"` by default, or `kind = "node"` for a named
15
+ integration point. The optional `target` is a node ticket id in the same source;
16
+ omission means the configured `baseBranch` root. Nodes may target other nodes.
17
+ Ready node tickets open integration branches. Work claims freeze their target
18
+ identity and branch. Blockers remain a separate graph.
19
+
20
+ Use `ab ticket create "Integration" --body spec.md --kind node`, then
21
+ `ab ticket update <id> --target <node-id>`. Clear a target with `--no-target`;
22
+ reset kind with `--kind work`. Omitted fields preserve existing values.
23
+ `ab ticket show <id> [--json]` exposes both fields; `ab ticket tree [--json]`
24
+ shows the configured root and every ticket, including completed work and empty
25
+ nodes, nested by target with state. Siblings are sorted by id. Invalid external
26
+ graphs and listing diagnostics are reported explicitly.
27
+
28
+ Changing an open node target re-parents its branch and existing PR; `--no-target`
29
+ moves it to the configured root. The dispatcher confirms source metadata, replays
30
+ only node-owned contributions onto the new parent, then retargets the same review.
31
+ Children follow through the ordinary cascade; conflicts use normal source-aware
32
+ reconcile. Pending moves block verification and landing. Cycles, non-open parents,
33
+ landing/closing nodes and unsupported forge retargeting are refused with a reason.
34
+ Busy operations must settle first. Changing a claimed work target is refused before
35
+ any combined patch is written: abort and re-dispatch instead. Direct provider edits
36
+ are observed too; invalid edits leave effective ancestry unchanged with a durable
37
+ diagnostic. Status shows effective ancestry; ticket tree shows source metadata.
38
+
39
+ Targets must exist and be nodes in the configured source. Self-targeting,
40
+ ancestor cycles and demoting a node with targeting tickets are refused before
41
+ any part of the requested update is written, regardless of ticket state.
42
+ Clear or reparent its children before demotion. File frontmatter persists the
43
+ fields; `ab ticket edit` displays them read-only. Change them through update.
44
+ Kind and target participate in content revisions and revision-checked writes.
45
+ File writes retain their existing best-effort, unlocked concurrency semantics.
46
+
47
+ Linear uses the exact `node` issue label for kind and the parent relation for
48
+ target, only when the parent carries that label. Ordinary grouping parents do
49
+ not impose targets and survive unrelated updates. Explicit target clear clears
50
+ the parent relation. Label replacements can demote nodes and receive the same
51
+ guards; explicit kind and label instructions must agree about `node`. Label
52
+ and parent connections are fully paginated. Linear still refuses guarded writes.
53
+
54
+ Hosted sources and legacy plugins read as work with no target and refuse any
55
+ explicit metadata write, including clears and mixed patches, with guidance to
56
+ use a capable source. No hosted storage or protocol change is implied.
57
+
12
58
  ## Hosted ticket ids
13
59
 
14
60
  When `[tickets].source = "hosted"`, use readable ids such as `ENG-12` with
@@ -132,6 +178,13 @@ bounces.
132
178
  **Don't hand-move anything out of `doing/`** — a build owns it. If you need to
133
179
  stop a build, that's `ab` (or a human), not `mv`.
134
180
 
181
+ When a conversation queues work by moving it into `ready/` (or the configured
182
+ ready state of any source), the agent that queued it becomes its operator by
183
+ default, as the `ab-spec` skill describes under "After filing": load the
184
+ `ab-operate` skill and shepherd those builds to completion unless the human
185
+ says they will operate them, hands them to another agent, or the session
186
+ cannot keep a long-running watch.
187
+
135
188
  ## Icebox
136
189
 
137
190
  `icebox/` is work deliberately deferred, groomed or not, that nothing
@@ -235,13 +288,13 @@ revisions rather than ignoring them.
235
288
 
236
289
  `ab ticket edit <id>` opens `$VISUAL`, falling back to `$EDITOR`, using TOML
237
290
  frontmatter and a Markdown body. Only title, body and labels are editable;
238
- id, blockers, creation key and reference comments are read-only. It saves only
291
+ kind, target, id, blockers, creation key and reference comments are read-only. It saves only
239
292
  changed fields with the opening revision. Unchanged or formatting-only edits
240
293
  write nothing. On conflict, invalid input or editor failure, the error names an
241
294
  absolute file path containing the edited text. Read the current ticket and
242
295
  reapply the intended changes before retrying; conflicts are never merged.
243
296
 
244
- File and Linear revisions fingerprint title, body, canonical label/blocker sets
297
+ File and Linear revisions fingerprint kind, target, title, body, canonical label/blocker sets
245
298
  and state; reverting identical content restores its fingerprint. File checks
246
299
  re-read immediately before writing, with the existing no-lock race window.
247
300
  Direct file edits and state-directory moves change revisions. File comments
@@ -5,6 +5,9 @@
5
5
  baseBranch = "main"
6
6
  capacity = 4
7
7
 
8
+ # First matching rule wins. Empty rules: leaves auto, nodes consent.
9
+ landing = []
10
+
8
11
  # Commands are derived by the setup agent from this repository's actual toolchain.
9
12
  [commands]
10
13