@defrex/autobuild 1.7.0 → 1.8.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 (116) hide show
  1. package/README.md +1 -1
  2. package/SPEC.md +316 -47
  3. package/docs/answering-blocked-builds.md +44 -3
  4. package/docs/architecture.md +62 -7
  5. package/docs/cli.md +1 -0
  6. package/docs/configuration-overview.md +1 -1
  7. package/docs/configuration.md +49 -9
  8. package/docs/dispatcher.md +1 -1
  9. package/docs/integration-overview.md +2 -2
  10. package/docs/integration-tree.md +7 -4
  11. package/docs/merge-policy.md +78 -6
  12. package/docs/migration-1.0.md +4 -2
  13. package/docs/operating.md +3 -2
  14. package/docs/operator-api.md +26 -5
  15. package/docs/operator-surfaces.md +10 -0
  16. package/docs/plugin-authoring.md +1 -1
  17. package/docs/remote-store-protocol.md +9 -1
  18. package/docs/restacking.md +23 -4
  19. package/docs/ticket-dependencies.md +9 -4
  20. package/docs/tickets.md +1 -1
  21. package/docs/troubleshooting.md +1 -1
  22. package/package.json +3 -3
  23. package/packages/core/src/cli/attention.ts +1 -0
  24. package/packages/core/src/cli/build-control.ts +65 -7
  25. package/packages/core/src/cli/context.ts +55 -14
  26. package/packages/core/src/cli/dashboard/actions.ts +13 -4
  27. package/packages/core/src/cli/dashboard/landing-display.ts +32 -8
  28. package/packages/core/src/cli/dashboard/model.ts +61 -8
  29. package/packages/core/src/cli/dashboard/render.ts +28 -3
  30. package/packages/core/src/cli/dashboard/tree.ts +9 -1
  31. package/packages/core/src/cli/help.ts +69 -7
  32. package/packages/core/src/cli/landings.ts +1 -1
  33. package/packages/core/src/cli/main.ts +60 -9
  34. package/packages/core/src/cli/publication-settlement.ts +10 -0
  35. package/packages/core/src/cli/status.ts +178 -12
  36. package/packages/core/src/cli/terminals.ts +197 -4
  37. package/packages/core/src/cli/wait.ts +1 -0
  38. package/packages/core/src/cli/watch.ts +71 -0
  39. package/packages/core/src/config/landing.ts +12 -0
  40. package/packages/core/src/config/path-selectors.ts +68 -0
  41. package/packages/core/src/config/schema.ts +40 -58
  42. package/packages/core/src/events/catalog.ts +17 -3
  43. package/packages/core/src/events/compatibility.ts +2 -1
  44. package/packages/core/src/events/head-paths-limits.ts +25 -0
  45. package/packages/core/src/events/payloads.ts +315 -20
  46. package/packages/core/src/events/policy.ts +21 -0
  47. package/packages/core/src/events/repository.ts +30 -1
  48. package/packages/core/src/kernel/__snapshots__/reducer-accumulator-shapes.json +247 -6
  49. package/packages/core/src/kernel/consent-revocation.ts +72 -0
  50. package/packages/core/src/kernel/dispatch-capacity.ts +19 -8
  51. package/packages/core/src/kernel/engine.ts +48 -8
  52. package/packages/core/src/kernel/head-paths-state.ts +63 -0
  53. package/packages/core/src/kernel/head-paths.ts +401 -0
  54. package/packages/core/src/kernel/landing-policy-identity.ts +20 -0
  55. package/packages/core/src/kernel/landing-policy.ts +55 -2
  56. package/packages/core/src/kernel/landing-readiness.ts +104 -9
  57. package/packages/core/src/kernel/landing-state.ts +44 -4
  58. package/packages/core/src/kernel/leaf-restack-base.ts +34 -0
  59. package/packages/core/src/kernel/leaf-restack-state.ts +22 -2
  60. package/packages/core/src/kernel/log-index.ts +27 -1
  61. package/packages/core/src/kernel/node-polling.ts +13 -3
  62. package/packages/core/src/kernel/node-restack-state.ts +8 -1
  63. package/packages/core/src/kernel/node-restack-transaction.ts +45 -0
  64. package/packages/core/src/kernel/read-deferrals.ts +3 -1
  65. package/packages/core/src/kernel/read-facts.ts +28 -1
  66. package/packages/core/src/kernel/reducer-registry.ts +22 -1
  67. package/packages/core/src/kernel/reducer.ts +316 -17
  68. package/packages/core/src/kernel/target-observation.ts +2 -5
  69. package/packages/core/src/kernel/terminal-guard.ts +52 -3
  70. package/packages/core/src/kernel/ticket-handbacks.ts +40 -0
  71. package/packages/core/src/kernel/ticket-preparation.ts +12 -1
  72. package/packages/core/src/kernel/ticket-wait.ts +345 -0
  73. package/packages/core/src/kernel/verify-applicability.ts +9 -19
  74. package/packages/core/src/ontology.ts +1 -0
  75. package/packages/core/src/operator/annotations.ts +6 -0
  76. package/packages/core/src/operator/index.ts +3 -0
  77. package/packages/core/src/operator/protocol.ts +15 -2
  78. package/packages/core/src/operator/registry.ts +97 -5
  79. package/packages/core/src/operator/repository-events.ts +67 -0
  80. package/packages/core/src/ports/tickets/fake.ts +5 -0
  81. package/packages/core/src/ports/types.ts +3 -2
  82. package/packages/core/src/processes/build-execution-state.ts +30 -1
  83. package/packages/core/src/processes/build-runner.ts +150 -18
  84. package/packages/core/src/processes/dispatcher.ts +739 -97
  85. package/packages/core/src/processes/execution-no-progress.ts +22 -2
  86. package/packages/core/src/processes/phase-failure-budget.ts +1 -0
  87. package/packages/core/src/processes/publication-state.ts +6 -1
  88. package/packages/core/src/store/digest.ts +41 -2
  89. package/packages/core/src/store/reduced-reads.ts +4 -1
  90. package/packages/core/src/store/reducer-value-shapes.json +10108 -8432
  91. package/packages/core/src/store/remote/client.ts +28 -2
  92. package/packages/core/src/store/remote/protocol.ts +11 -1
  93. package/packages/core/src/store/remote/released-clients.json +22 -0
  94. package/packages/core/src/store/remote/released-reducer-values/1.8.0.json +29043 -0
  95. package/packages/core/src/store/remote/released-reducer-values/index.ts +2 -0
  96. package/packages/core/src/store/repo-state-events.ts +2 -0
  97. package/packages/core/src/store/types.ts +16 -0
  98. package/packages/core/src/testing/reduced-read-budget.ts +347 -0
  99. package/skills/code-review/SKILL.md +8 -0
  100. package/skills/finalize/SKILL.md +4 -0
  101. package/skills/guide/SKILL.md +125 -26
  102. package/skills/guide/references/integration-tree.md +7 -4
  103. package/skills/guide/references/merge-policy.md +78 -6
  104. package/skills/guide/references/migration-1.0.md +4 -2
  105. package/skills/guide/references/operator-api.md +26 -5
  106. package/skills/guide/references/plugin-authoring.md +1 -1
  107. package/skills/guide/references/remote-store-protocol.md +9 -1
  108. package/skills/guide/references/restacking.md +23 -4
  109. package/skills/guide/references/ticket-dependencies.md +9 -4
  110. package/skills/implement/SKILL.md +15 -1
  111. package/skills/operate/SKILL.md +104 -13
  112. package/skills/plan/SKILL.md +17 -2
  113. package/skills/plan-review/SKILL.md +8 -0
  114. package/skills/reconcile/SKILL.md +21 -5
  115. package/skills/tickets/SKILL.md +5 -4
  116. package/templates/hosted-service/package.json +2 -2
@@ -3,7 +3,12 @@
3
3
  A leaf contributes one net change, independent of its WIP commit count. Before
4
4
  verification the kernel collapses its contribution relative to the effective
5
5
  diff base and replays it onto the sampled destination. Implementation and review
6
- do not rewrite history. Verification failures return to implementation; later
6
+ do not rewrite history; the one exception is a build resuming from a ticket
7
+ wait, which the kernel restacks between phases so the resumed phase sees the
8
+ merged blockers. A build with nothing published fast-forwards to the
9
+ destination only when its local branch has no commits the destination lacks and
10
+ its workspace has no uncommitted tracked changes; otherwise the restack fails
11
+ and that local work is never discarded. Verification failures return to implementation; later
7
12
  commits append until the next approved cycle. Later reviews use the effective
8
13
  base from the preceding successful restack; the original cut remains provenance.
9
14
 
@@ -49,7 +54,18 @@ polls read no receipts or event rows.
49
54
 
50
55
  Accepted destination observations are durable `target.moved` facts, including while an
51
56
  agent runs. Verify-entry restack freezes a current base before verification;
52
- path selection excludes upstream-only paths. After finalize and post-steps,
57
+ path selection excludes upstream-only paths. A build leaving a ticket wait
58
+ restacks with trigger `wait-resume` before its declaring phase resumes, when the
59
+ target moved from the base its work sits on; an unchanged target resumes
60
+ without a restack. Published work replays through the guarded restack, and a
61
+ conflict runs reconcile before the declaring phase resumes. With nothing
62
+ published, the local branch fast-forwards to the target (`restack.advanced`)
63
+ only when it has no commits the target lacks and the workspace has no
64
+ uncommitted tracked changes; unpublished local commits or uncommitted tracked
65
+ changes prevent the advance and are never discarded. A wait declared by a
66
+ reconcile session whose replay recorded no publish intent supersedes that
67
+ replay when the target moved, discarding its undeposited resolution, and
68
+ replays the published head onto the current target instead. After finalize and post-steps,
53
69
  waiting leaves restack when the target moves. Node-target finalize contributions
54
70
  are canonicalized before guarded merge even when the target SHA is unchanged.
55
71
  Clean replay starts no agent. A clean waiting leaf rewrite preserves completed
@@ -68,7 +84,7 @@ dependency presence requires an ancestor change; on `ab restack <node>`; or on
68
84
  accepted re-parenting. There is no eager mode or cadence option. Nested nodes
69
85
  need their own demand. Existing frozen transactions, including ones reserved
70
86
  before upgrade, finish first; later demand coalesces onto the latest parent.
71
- Leaves keep verify-entry and awaiting-merge restacks for every target.
87
+ Leaves keep verify-entry, wait-resume and awaiting-merge restacks for every target.
72
88
 
73
89
  For observation cadence, durable wakes and last-check evidence, see
74
90
  [node polling and status](integration-tree.md#polling-and-status).
@@ -240,7 +256,10 @@ Before claiming, the dispatcher journals a repository-scoped preparation intent;
240
256
  a won claim, the selected creation slug and, when the build store attests keyed
241
257
  creation, the attempt's creation key are durable boundaries. Caught
242
258
  asset-copy, spec-authoring, naming, and build-creation failures return the ticket
243
- to configured Ready; a nonconforming spec goes to configured Triage. Recovery
259
+ to configured Ready; a nonconforming spec goes to configured Triage. Once a
260
+ confirmed claim's ticket is back, one repository `ticket.handed-back` reports it
261
+ (cause `preparation-failed` or `spec-bounce`, with the missing spec parts) before
262
+ the attempt resolves; an attempt reports at most once. Recovery
244
263
  point-reads the selected slug and, for a keyed attempt, the canonical slug derived
245
264
  from the repository, selected slug and key: one matching record and atomic
246
265
  `build.created` retain ownership even if creation threw after committing or its
@@ -58,10 +58,15 @@ the ticket ready.
58
58
  ## Already-claimed work
59
59
 
60
60
  Adding blockers does not stop a build already claimed from an earlier listing.
61
- When the human authorizes restarting premature work: request `ab abort <slug>`,
62
- wait for dispatcher cleanup to finish and return the ticket to triage, verify
63
- or repair the blocker set, and only then move the ticket back to ready. Moving
64
- the ticket before cleanup finishes can be overwritten by cleanup. Ready with
61
+ When the human authorizes restarting premature work and the blocker set is
62
+ already right, request `ab abort <slug> --to ready`: cleanup moves the ticket
63
+ straight back to ready with its blockers kept, so no second move is needed.
64
+ If the ticket no longer meets the spec standard, cleanup returns it to triage
65
+ instead and the hand-back names the missing parts; groom it before moving it
66
+ to ready.
67
+ If the blockers need changing first, verify or repair them once the
68
+ `ticket.handed-back` repository event for that build arrives; the dispatcher
69
+ writes nothing to the ticket for that hand-back afterwards. Ready with
65
70
  unresolved blockers is the normal waiting state: dispatch rechecks dependencies
66
71
  and claims the ticket only after they resolve and other readiness gates pass.
67
72
 
@@ -69,7 +69,7 @@ manifest-directed artifact paths remain authoritative. Never commit scratch.
69
69
  request; fix the failure and retry in the same session. In a remote workspace it records one publication
70
70
  request and parks while the dispatcher publishes and records completion;
71
71
  **do not run `ab done` again** after that success message. It is your only
72
- terminal command besides `ab escalate`. If it reports a validation error,
72
+ terminal command besides `ab escalate` and `ab wait-on`. If it reports a validation error,
73
73
  fix what it names and run it again.
74
74
 
75
75
  An empty contribution is refused: when HEAD has no commits over the
@@ -137,6 +137,20 @@ manifest-directed artifact paths remain authoritative. Never commit scratch.
137
137
  ab escalate "…the question…" --refs src/whatever.ts
138
138
  ```
139
139
 
140
+ - **Wait for another ticket instead of escalating.** If the build cannot
141
+ proceed until another ticket merges — the plan needs code that ticket owns
142
+ and it has not landed — commit your work first (the worktree must be clean;
143
+ the command publishes your commits), then end the session with:
144
+
145
+ ```
146
+ ab wait-on <ticket-id>... --reason "…what this change needs from them…"
147
+ ```
148
+
149
+ The build parks without holding a slot. When every named ticket completes,
150
+ the dispatcher ends the wait and implement resumes at the same round, on the
151
+ target's current head, with a `wait` block in `$AB_CONTEXT_DIR/guidance.json`.
152
+ Escalate as before for anything else.
153
+
140
154
  Read the manifest path printed by `ab context`. Its `materialized` keys are
141
155
  relative to `contextDir`: join them to locate collision-adjusted inputs.
142
156
  Manifest path fields are workspace-relative; use `notesPath` for producer notes.
@@ -118,7 +118,7 @@ Credential/process changes remain subject to the Boundaries below.
118
118
  `ab watch --operator --json` is the standing monitor. Keep its default filter: every
119
119
  record calls for action. It reports failed node verification, build escalations, persistent janitor failures and their escalations, merge decisions,
120
120
  harvest escalations/recovery exhaustion, automatic upgrade failures and runtime rollbacks, rejected configuration, reloads needing
121
- restart, abnormal dispatcher stops/loss, abandoned ticket preparations, ticket-source and forge degradation past reset (15 minutes
121
+ restart, abnormal dispatcher stops/loss, abandoned ticket preparations, ticket hand-backs (`ticket.handed-back`), ticket-source and forge degradation past reset (15 minutes
122
122
  for ticket sources without reset), forge rate limits outside the dispatcher's credential
123
123
  (`forge.credential-limited`), and five minutes of continuous tick failures. Advertised resets
124
124
  wait for a post-reset tick to finish before requiring action; ordinary recovery
@@ -268,13 +268,17 @@ that appear after you arm. Finishing the initially queued set is no reason to st
268
268
  alive and keep discovering work until the human ends or hands off the role.
269
269
 
270
270
  Use `ab wait` and named unflagged watches only as separate diagnostics. They
271
- cannot replace the registered monitor or its cursor. In MCP, use the existing
272
- registry monitoring tools; operator presence is not exposed there, and its
271
+ cannot replace the registered monitor or its cursor. In MCP, poll
272
+ `repository.events` for repository attention and `builds.events` for each build;
273
+ operator presence is not exposed there, and its
273
274
  `repository.status` marks presence `unavailable` rather than absent.
274
275
 
275
276
  ### Inspect
276
277
 
277
278
  - `ab builds [--queued] [--all] [--json]` — builds and their effective status.
279
+ A build parked on a ticket wait lists as `waiting`, with `waiting on <ids>`
280
+ after its phase; in `--json` its `status` stays `blocked` and `wait` carries
281
+ `state` and `tickets`.
278
282
  - `ab build status <slug> [--events N]` — one build's detail, chronological runner
279
283
  attaches with runtime identity, and recent events. Historical runtime is null
280
284
  in JSON and unrecorded in human output.
@@ -296,26 +300,46 @@ Read events with a cursor or a small `--events` count; logs are long.
296
300
  for verification on the same head; children and contributions remain intact.
297
301
  Active work, pause, pending controls and merge intent refuse revision. Leaves
298
302
  require an escalation and restart from plan after any unfinished reconcile
299
- resumes under the revised spec and its publication is confirmed. Run `ab help answer` for the full menu.
303
+ resumes under the revised spec and its publication is confirmed. Answering a
304
+ ticket wait's escalation ends the wait early; the dispatcher ends it when its
305
+ tickets complete (see ticket wait attention). Run
306
+ `ab help answer` for the full menu.
300
307
  - `ab pause <slug>` / `ab resume <slug>`; `ab pause --all` / `ab resume --all`
301
308
  hold and release the whole repository. Pause immediately interrupts live agent
302
309
  sessions and acknowledges after they stop. Resume continues the same native
303
310
  session where supported; remote or unsupported sessions rerun fresh, with a
304
311
  reason recorded in session.resume-fallback. Without a live agent (including
305
312
  check-only verify), pause still takes effect at the next boundary.
306
- - `ab abort <slug>` — destructive: closes the PR, removes branches, and
307
- returns the ticket to triage.
313
+ - `ab abort <slug> [--to triage|ready] [--reason <text>]` — destructive:
314
+ closes the PR, removes branches, and hands the ticket back to triage by
315
+ default. To free a build's slot while it waits on other work, use
316
+ `--to ready`: the ticket goes straight to ready with its blockers kept and
317
+ redispatches once they merge, so it needs no second move. A ticket that no
318
+ longer conforms to the spec standard falls back to triage, and the comment
319
+ lists what is missing. `--reason` is quoted in the hand-back comment.
320
+ Cleanup is asynchronous: act on the `ticket.handed-back` repository event,
321
+ not on `build.aborted` or the build leaving `ab builds`.
308
322
  - `ab hold <slug>` — persistently hold a merge and revoke earlier consent.
309
323
  - `ab merge <slug>` — consent to a ready merge and clear its hold. Consent
310
- survives restacks and verification; use hold to withdraw it when work changes.
324
+ survives clean restacks and verification; use hold to withdraw it when work
325
+ changes. Consent given under a `[[merge]]` rule with `paths` or `within`
326
+ predicates is revoked when a reconcile's own edits touch a file those
327
+ predicates match; `landing.consent-revoked` reports it.
311
328
  Read the matched policy, readiness, acknowledged command and gate deferral in
312
329
  build status before acting. Work the consent queue by checking completeness
313
330
  and current verification, then issuing merge for the chosen merge. A merge
314
331
  acknowledgement accepts consent; it never promises that gates passed. A
315
- `merge-not-ready` or `node-incomplete` refusal records no consent and no
332
+ `merge-not-ready`, `node-incomplete` or `head-mismatch` refusal records no consent and no
316
333
  landing, though a node's completeness check may save an
317
334
  `integration.observed` diagnostic; re-read status and act on the stated
318
335
  reason.
336
+ - `ab merge <slug> --head <sha>` — bind consent to the head you reviewed. It
337
+ records consent only when `<sha>` (full or at least seven characters) is the
338
+ build's current candidate head; otherwise it refuses with code
339
+ `head-mismatch`, records nothing, and names the current head. Review that
340
+ head before retrying. The guard applies only when consent is given: consent
341
+ still survives later clean restacks, and build status shows the consented
342
+ head beside the current one.
319
343
  - Configure ordered `[[merge]]` rules for project policy through ab-guide.
320
344
  Repository auto-merge defaults and per-build auto-merge toggles are retired.
321
345
 
@@ -396,19 +420,30 @@ Your tools are the operator registry. The read-only ones are always safe:
396
420
  - `builds.artifact` — one artifact's bytes, base64-encoded.
397
421
  - `repository.status` — the repository's derived status. Its `operator.presence`
398
422
  is `unavailable`: it does not load presence, so it is not evidence of absence.
423
+ - `repository.events` — your repository attention watch: the repository journal
424
+ after a `cursor`, with an optional bounded `waitSeconds` (at most 30). Its
425
+ default `attention` filter returns exactly the repository records
426
+ `ab watch --operator` reports, such as `ticket.handed-back`; `filter: "all"`
427
+ returns every event. Omit the cursor once to get a baseline, then pass back
428
+ the returned cursor, which advances past filtered events; follow it while
429
+ `hasMore` is true. On `code: "cursor-too-old"`, re-baseline and reconcile
430
+ `repository.status`. Build attention comes from `builds.events`.
399
431
  - `harvest.status` — the observation workflow's current state.
400
432
 
401
433
  The mutating ones carry the human's authority — prefer the narrowest
402
434
  that does the job, and say what you are doing before you do it:
403
435
 
404
436
  - `builds.control` — pause, resume, abort, or discard a build. `abort` and
405
- `discard` are destructive to in-flight work.
437
+ `discard` are destructive to in-flight work. `abort` accepts `to`
438
+ (`triage`, the default, or `ready`) and a `reason`, as `ab abort` does.
406
439
  - `builds.answer` — answer an open escalation: guidance text, a retry, a
407
440
  review-round ceiling, or a revise-spec resolution. Eligible idle collecting or
408
441
  verification-failed nodes accept body/ticket spec revision without an escalation;
409
442
  the caller supplies the amended body for ticket origin. The node recollects and
410
443
  verifies; leaves require an escalation and restart from plan after any unfinished reconcile
411
- resumes under the revised spec and its publication is confirmed.
444
+ resumes under the revised spec and its publication is confirmed. Answering a
445
+ ticket wait's escalation ends the wait early; the dispatcher ends it when its
446
+ tickets complete.
412
447
  - `tickets.list`, `tickets.get` — read the ticket queue and one ticket. A long
413
448
  queue pages with `limit`, `offset` and `order`; `total` counts every match.
414
449
  - `tickets.create` — file a new ticket from a conversation. A ticket filed
@@ -455,6 +490,10 @@ Treat every default-watch record as a call to act:
455
490
  - `build.consent-ready`: inspect the one consent queue, then merge or hold the
456
491
  selected candidate under the human's policy. Unready or stale candidates
457
492
  do not produce this observation.
493
+ - `landing.consent-revoked`: a reconcile edited files protected by the rule
494
+ your consent was given under. Review the reconcile's edits to the named files
495
+ at the new head, then consent again with `ab merge <slug> --head <new head>`
496
+ or hold it. The build is back in the consent queue until you do.
458
497
  - `build.merge-decision`: diagnose the current merge-gate deferral or unsafe
459
498
  forge outcome. Consent and hold decisions use only `build.consent-ready`.
460
499
  - Harvest escalation or recovery exhaustion: inspect harvest status and resolve
@@ -492,6 +531,16 @@ Treat every default-watch record as a call to act:
492
531
  assuming it sits in Doing. Decide whether to leave it finished or cancelled,
493
532
  or return it to Ready for another attempt. Each abandonment reports once;
494
533
  history does not replay.
534
+ - Ticket hand-back (`ticket.handed-back`): the dispatcher returned a claimed or
535
+ ready ticket other than as completion, and the move is already committed.
536
+ `cause` is `abort`, `spec-bounce`, `preparation-failed`, `pr-closed` or
537
+ `discard`; `state` and `role` say where it went, `requested` the role an abort
538
+ asked for when it fell back, `missing` the spec-standard parts, and `reason`
539
+ the operator's text. An abort to ready needs nothing more. For triage, groom
540
+ the ticket and move it on when intended; for a spec bounce, fix the missing
541
+ parts first. Moving the ticket as soon as the record arrives is safe: no later
542
+ dispatcher write for the same hand-back overrides it. Each hand-back reports
543
+ once.
495
544
 
496
545
  Do not re-derive history the build's events already tell you; read events
497
546
  with a cursor and keep it short.
@@ -583,16 +632,19 @@ or queue entries for merge ancestry after a source ticket changes.
583
632
  Start with `ab merges --json` (MCP `merges.list`). This is the one queue of
584
633
  ready merges needing a decision: consent-policy candidates and held ready
585
634
  candidates. Entries include the target, branch preview, candidate head/parent,
635
+ the live `currentHead` and the `consentedHead` (null without consent),
586
636
  verification receipts and node children/completeness. Unknown completeness is
587
637
  not zero children. A changed head or parent must regain current verification;
588
638
  unfinished or automatically authorized candidates do not ask for attention.
589
639
  Queued and held candidates hold no capacity slot; one that must re-verify or
590
640
  reconcile waits for a slot ahead of new ticket claims, so a full repository
591
- delays it without failing it.
641
+ delays it without failing it. A build waiting on other tickets holds no slot
642
+ either, and takes one ahead of new claims once its wait ends.
592
643
 
593
644
  Select a queue build in the terminal and use `l merge` or `o hold`, or run
594
645
  `ab merge <slug>` / `ab hold <slug>`. MCP uses `builds.control` with action `merge`
595
- or `hold`. Hold is available before readiness and suppresses automatic merge.
646
+ or `hold`; its optional `head` binds merge consent to the reviewed head, like
647
+ `ab merge --head`. Hold is available before readiness and suppresses automatic merge.
596
648
  Merge rechecks readiness and live node completeness, so act on failures by
597
649
  refreshing the facts. Open children keep a node collecting; a child moved to
598
650
  the rejected role no longer does. When integration
@@ -603,7 +655,7 @@ Watch for decisions and conflicts with `ab watch --operator --json`; save its op
603
655
  and resume with `ab watch --operator --since <watch-cursor> --json`. On
604
656
  `cursor-too-old`, re-arm without `--since`, reconcile status and acknowledge the
605
657
  unavailable historical gap. Default attention includes
606
- failed node verification (`integration.verification-failed`), node merges, node item conflicts, conflicted leaf replays and derived
658
+ failed node verification (`integration.verification-failed`), node merges, node item conflicts, conflicted leaf replays, revoked protected consent (`landing.consent-revoked`) and derived
607
659
  `build.consent-ready` observations, including already-ready merges on first
608
660
  repository-wide discovery. Readiness is identified by its durable
609
661
  entry position: resuming suppresses the same episode, while a new candidate or
@@ -623,6 +675,45 @@ Repeated classified read failures park immediately again; they do not consume
623
675
  the phase failure allowance. Default watch and attention waits deliver the new
624
676
  raise with its own event type.
625
677
 
678
+ ### Ticket wait attention
679
+
680
+ A build that `ab builds` and both dashboards show as `waiting` / `WAITING`,
681
+ with an amber `waiting on <ids> — <reason>` line, is a ticket wait. It is not
682
+ a red blocker; its escalation question begins `Waiting on`. Its agent declared with `ab wait-on` that it cannot proceed until
683
+ the named tickets complete, and the dispatcher recorded them in the build
684
+ ticket's `blockedBy`. It holds no capacity slot and keeps its branch and
685
+ workspace; `ab build status` shows a `waiting on:` line naming the tickets.
686
+ Drive the named tickets to completion: the dispatcher ends the wait on its
687
+ first tick after every named ticket completes, with no answer needed, and a
688
+ wait with some tickets still open stays in place. Answer sooner only when the
689
+ needed work landed another way or the wait is mistaken; any answer ends the
690
+ wait early. Either way the build then takes a
691
+ slot ahead of new ticket claims. If its target moved, it first restacks onto the
692
+ target's current head, so the resumed phase sees the merged blockers;
693
+ `ab build status` shows a `restack:` line with trigger `wait-resume`, and a
694
+ conflicting restack shows as `reconcile` before the phase resumes. The phase
695
+ that declared the wait then resumes, told what it waited on. Until the
696
+ dispatcher accepts a request, the build keeps its slot and `ab build status`
697
+ reports the wait as requested. A wait declared in `implement` first publishes
698
+ the build's commits; if that publication is lost, the wait is refused
699
+ (`publication-lost`) and implement re-runs with the refusal as guidance.
700
+
701
+ A waited ticket that is rejected or deleted can never complete. The dispatcher
702
+ then ends the wait with an ordinary red policy escalation, `wait-unresolvable`,
703
+ in the default attention filter, whose question names each such ticket and why.
704
+ Answer it with guidance to resume the declaring phase without that ticket
705
+ (the session is again told what it waited on), with `--revise-spec` when the
706
+ spec has to change, or abort the build. Do not leave it waiting for the ticket
707
+ to come back: moving the ticket out of the rejected state later does not
708
+ re-enter the wait.
709
+
710
+ Entering and leaving a wait (`wait.entered`, `wait.ended`, and the
711
+ `escalation.answered` that ends a wait) are routine, not default-watch
712
+ attention. To see waits begin and end, run a separate diagnostic
713
+ `ab watch --event 'wait.*' --event escalation.answered --json` alongside the
714
+ standing watch. On either dashboard, `r` / RESUME on a waiting build answers
715
+ the wait and ends it early.
716
+
626
717
  ### Janitor escalation attention
627
718
 
628
719
  `build.janitor-escalated` is ordinary blocked attention for a janitor failure
@@ -166,6 +166,21 @@ has no `feedback` field; plan from the spec.
166
166
  On any round that proceeds rather than escalates, deposit a fresh
167
167
  `ab artifact put plan` — revisions accumulate; never edit history.
168
168
 
169
+ ## Waiting on other tickets
170
+
171
+ If the build cannot proceed until another ticket merges — the plan depends on
172
+ code that ticket owns and it has not landed — do not escalate. End the session
173
+ with:
174
+
175
+ ```
176
+ ab wait-on <ticket-id>... --reason "…what this plan needs from them…"
177
+ ```
178
+
179
+ The build parks without holding a slot. When every named ticket completes,
180
+ the dispatcher ends the wait and this phase resumes at the same round, on the
181
+ target's current head, with a `wait` block in `$AB_CONTEXT_DIR/guidance.json` naming
182
+ what you waited on. Escalate as before for anything else.
183
+
169
184
  ## If the spec is the problem
170
185
 
171
186
  If the spec is contradictory, unbuildable, or wrong — do not plan around it.
@@ -175,8 +190,8 @@ Park the build for external judgment from the operator agent or a human:
175
190
  ab escalate "…the question, concretely…" --refs "$AB_CONTEXT_DIR/spec.md"
176
191
  ```
177
192
 
178
- This is also a terminal command; use exactly one of `ab done` or
179
- `ab escalate` per session.
193
+ This is also a terminal command; use exactly one of `ab done`,
194
+ `ab escalate` or `ab wait-on` per session.
180
195
 
181
196
  Read the manifest path printed by `ab context`. Its `materialized` keys are
182
197
  relative to `contextDir`: join them to locate collision-adjusted inputs.
@@ -57,6 +57,14 @@ verdict travels the typed channel; nothing you print matters to the pipeline.
57
57
  ab verdict escalate --reason "…" --notes "$AB_CONTEXT_DIR/plan-review.md"
58
58
  ```
59
59
 
60
+ If you cannot judge the plan until another ticket merges — it builds on
61
+ code that ticket owns and has not landed — end the session with
62
+ `ab wait-on <ticket-id>... --reason "…"` instead of a verdict or an
63
+ escalation. The build parks without a slot; when every named ticket
64
+ completes, this same review round resumes on the target's current head,
65
+ with a `wait` block in `$AB_CONTEXT_DIR/guidance.json`. Escalate as before for
66
+ anything else.
67
+
60
68
  ## Escalating an oversized plan
61
69
 
62
70
  When fulfilling the spec clearly exceeds one implement session, write review
@@ -40,8 +40,8 @@ manifest-directed artifact paths remain authoritative. Never commit scratch.
40
40
  1. Run `ab context`. Read the printed manifest and its `materialized` paths for
41
41
  the spec, approved plan, implement-notes, and any `$AB_CONTEXT_DIR/guidance.json` guidance. `replay` names the
42
42
  original head, old contribution base, single change, frozen target base and
43
- whether replay conflicted. A replay may originate at verify entry before any
44
- PR exists; `restackId` identifies an adopted automatic transaction. Never fetch, merge, rebase, select another base,
43
+ whether replay conflicted. A replay may originate at verify entry or at a
44
+ ticket-wait resume before any PR exists; `restackId` identifies an adopted automatic transaction. Never fetch, merge, rebase, select another base,
45
45
  or move the named branch yourself. Missing replay inputs require escalation, except a node item uses `nodeChange` and `conflict.baseSha` instead of `replay`.
46
46
  If the manifest includes `workspaceRecovery`, read that materialized note.
47
47
  It distinguishes exact preserved commits restored before the session from
@@ -80,7 +80,9 @@ manifest-directed artifact paths remain authoritative. Never commit scratch.
80
80
  A publication success message parks this turn for kernel publication;
81
81
  do not repeat `ab done` after success. Post-reconcile verification follows the
82
82
  captured policy and begins a fresh cycle after confirmed publication. A conflict
83
- at initial verify entry still requires initial checks regardless of that policy.
83
+ at initial verify entry, or at a ticket-wait resume, still requires initial
84
+ checks regardless of that policy. After a wait-resume replay publishes, the
85
+ build resumes the phase that declared the wait.
84
86
 
85
87
  A leaf replay resumed after a spec revision uses the revised spec as its
86
88
  contract. Its historical plan and implement notes describe the retained change;
@@ -88,6 +90,20 @@ they cannot override that contract. After confirmed publication the build
88
90
  restarts planning, implementation and review before verification, rather than
89
91
  entering the ordinary post-reconcile verification cycle directly.
90
92
 
93
+ ## Waiting on other tickets
94
+
95
+ If the resolution needs work from other tickets that has not landed, end the
96
+ session with `ab wait-on <ticket-id>... --reason <text>` instead of
97
+ escalating. The build parks without a slot, and the wait ends by itself when
98
+ every named ticket completes. When
99
+ the wait ends and the target branch has moved, and no resolution of this
100
+ replay was deposited for publication, the kernel abandons this replay,
101
+ including any resolution you have not deposited with `ab done`, and prepares a
102
+ fresh replay onto the target's current head, which you then resolve. If the
103
+ target has not moved, you resume this same replay with its conflicts as you
104
+ left them. Escalate as before for anything that is not waiting on another
105
+ ticket to merge.
106
+
91
107
  ## When not to resolve
92
108
 
93
109
  Escalate semantic conflicts, incompatible or deleted branch history, or choices
@@ -100,8 +116,8 @@ ab escalate "The target changes the session-token format but the build keys its
100
116
  An operator answer in guidance is authoritative while the spec remains the
101
117
  contract. If they cannot both be satisfied, escalate the contradiction.
102
118
  Reconcile has no code-review round; escalate risky resolutions for external
103
- judgment. The only successful terminal commands are `ab done` and
104
- `ab escalate`.
119
+ judgment. The only successful terminal commands are `ab done`,
120
+ `ab escalate` and `ab wait-on`.
105
121
 
106
122
  Read the manifest path printed by `ab context`. Its `materialized` keys are
107
123
  relative to `contextDir`: join them to locate collision-adjusted inputs.
@@ -203,10 +203,11 @@ work proceeds, and urgency never stops a running build. To expedite a ticket,
203
203
  mark it urgent rather than moving other tickets out of `ready/`.
204
204
 
205
205
  When the dispatcher claims an eligible file ticket, it moves it to `doing/`,
206
- then to `done/` on merge or back to `triage/` if the build aborts or the spec
207
- bounces. A caught failure before build creation returns it to configured Ready
208
- after safe ownership checks; unfinished recovery stays durably tracked and
209
- withheld from another claim. Uncertain ownership or externally changed/missing
206
+ then to `done/` on merge or back to `triage/` if the build aborts (`ready/`
207
+ with `ab abort --to ready`) or the spec bounces. A caught failure before build
208
+ creation returns it to configured Ready after safe ownership checks. Every such
209
+ return reports one `ticket.handed-back` repository event once the move is done.
210
+ Unfinished recovery stays durably tracked and withheld from another claim. Uncertain ownership or externally changed/missing
210
211
  tickets end automatic recovery with an `abandoned` resolution, reported once
211
212
  in that tick's dispatcher diagnostics and once as default `ab watch`
212
213
  repository attention, leaving the ticket unchanged for operator inspection.
@@ -4,8 +4,8 @@
4
4
  "build": "ab-hosted-service-build"
5
5
  },
6
6
  "dependencies": {
7
- "@defrex/autobuild-hosted-store-service": "1.7.0",
8
- "@defrex/autobuild": "1.7.0",
7
+ "@defrex/autobuild-hosted-store-service": "1.8.1",
8
+ "@defrex/autobuild": "1.8.1",
9
9
  "next": "16.1.6",
10
10
  "react": "19.2.4",
11
11
  "react-dom": "19.2.4"