@defrex/autobuild 1.0.0-beta.4 → 1.0.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 (54) hide show
  1. package/README.md +1 -1
  2. package/SPEC.md +45 -36
  3. package/docs/agent-runtimes.md +157 -0
  4. package/docs/build-store.md +123 -0
  5. package/docs/builds.md +82 -0
  6. package/docs/cli.md +48 -0
  7. package/docs/configuration-overview.md +93 -0
  8. package/docs/configuration.md +1626 -204
  9. package/docs/dispatcher-hosting.md +115 -0
  10. package/docs/dispatcher.md +59 -0
  11. package/docs/forges.md +121 -0
  12. package/docs/getting-started.md +60 -0
  13. package/docs/glossary.md +60 -0
  14. package/docs/hosted-service.md +2 -2
  15. package/docs/intake.md +48 -0
  16. package/docs/integration-overview.md +81 -0
  17. package/docs/operating.md +114 -0
  18. package/docs/operator-api.md +6 -6
  19. package/docs/operator-surfaces.md +90 -0
  20. package/docs/overview.md +49 -0
  21. package/docs/plugin-authoring.md +426 -0
  22. package/docs/remote-store-protocol.md +8 -8
  23. package/docs/seams.md +66 -0
  24. package/docs/setup.md +8 -6
  25. package/docs/skills.md +119 -0
  26. package/docs/ticket-sources.md +132 -0
  27. package/docs/tickets.md +69 -0
  28. package/docs/troubleshooting.md +111 -0
  29. package/docs/upgrading.md +50 -0
  30. package/docs/verification.md +146 -0
  31. package/docs/website.md +47 -5
  32. package/docs/workspaces.md +152 -0
  33. package/package.json +5 -4
  34. package/packages/core/src/cli/env.ts +1 -1
  35. package/packages/core/src/cli/help.ts +4 -2
  36. package/packages/core/src/config/landing.ts +8 -0
  37. package/packages/core/src/config/reference-metadata.ts +31 -0
  38. package/packages/core/src/config/reference.ts +342 -0
  39. package/packages/core/src/config/roles.ts +1 -1
  40. package/packages/core/src/config/schema.ts +344 -6
  41. package/packages/core/src/ontology.ts +2 -2
  42. package/packages/core/src/open-map.ts +3 -1
  43. package/skills/finalize/SKILL.md +3 -1
  44. package/skills/guide/SKILL.md +42 -25
  45. package/skills/guide/references/operator-api.md +18 -10
  46. package/skills/guide/references/plugin-authoring.md +227 -303
  47. package/skills/guide/references/remote-store-protocol.md +8 -8
  48. package/skills/guide/references/setup.md +8 -6
  49. package/skills/implement/SKILL.md +4 -2
  50. package/skills/operate/SKILL.md +26 -27
  51. package/skills/plan/SKILL.md +12 -4
  52. package/skills/spec/SKILL.md +1 -1
  53. package/skills/tickets/SKILL.md +1 -1
  54. package/templates/hosted-service/package.json +2 -2
@@ -187,6 +187,12 @@ Naming inherits `[roles.default]` and can be overridden by `[roles.slug]`.
187
187
 
188
188
  ## Who does what
189
189
 
190
+ The **operator** is the role driving Autobuild through `ab` or MCP, normally
191
+ an agent. The **operator agent** takes that role; a human may drive the same
192
+ interface directly. The human is **you**, or the **maintainer**. Human actor
193
+ identities and session ownership attribute authority to the authorizing account,
194
+ not to the agent driving the tools.
195
+
190
196
  The distinctions that change an administrator's answer:
191
197
 
192
198
  - **Agents supply judgment** — planning, reviewing, implementing, verifying,
@@ -429,8 +435,8 @@ Rules are strict and blank predicates are rejected with their array index.
429
435
  | `label` | No | Exact, case-sensitive source ticket label sampled at readiness. |
430
436
  | `mode` | Yes | `auto` or `consent`. |
431
437
 
432
- Help the operator choose policy around their release process. A solo team can
433
- use one catch-all `mode = "auto"` rule. A team requiring an operator's review
438
+ Help the human choose policy around their release process. A solo team can
439
+ use one catch-all `mode = "auto"` rule. A team requiring a human's review
434
440
  for every landing can use one catch-all `mode = "consent"` rule. For release
435
441
  nodes that collect work automatically but require a final click, put an
436
442
  `into = "root"`, `mode = "consent"` rule first, followed by a catch-all
@@ -568,6 +574,14 @@ from the repository's actual toolchain, and asks the user about choices source
568
574
  cannot answer; deterministic init code never guesses a language or package
569
575
  manager.
570
576
 
577
+ Setup configures an **acceptance check** in every repository: a repository-owned
578
+ agent verify step that runs the built software, exercises each acceptance
579
+ criterion in the spec, attaches evidence, and returns a typed verdict. It is
580
+ not a test suite and leaves no test files behind. Wire an existing maintained
581
+ end-to-end or browser test suite into an ordinary `check` step. If none exists,
582
+ do not create one during setup. The acceptance check neither substitutes for
583
+ nor seeds a suite.
584
+
571
585
  ### `[verify]`
572
586
 
573
587
  Post-reconcile verification defaults to enabled: `[verify].afterReconcile = true`.
@@ -601,7 +615,7 @@ subtables are part of this section — their fields are listed here.
601
615
  | `steps` | `[]` | array of nonempty strings | Ordered configured universe of verify phases. Each name must have a matching `[verify.<step>]` table. |
602
616
  | `kind` | — | **required**, `"check"` \| `"agent"` | Discriminator. `check` is deterministic (command + pass/fail, never an agent); `agent` runs a skill that returns `pass`, `fail`, or `skip`. |
603
617
  | `command` | — | **required when `kind = "check"`**, nonempty string | Ref into `[commands]` — the key, not a shell string. Pass/fail is the command's exit status. |
604
- | `skill` | — | **required when `kind = "agent"`**, nonempty string | Installed skill name to run (e.g. a repository-authored `"verify-app-e2e"`). |
618
+ | `skill` | — | **required when `kind = "agent"`**, nonempty string | Installed skill name to run (e.g. a repository-authored `"verify-acceptance"`). |
605
619
  | `paths` | — | optional nonempty array of positive repository-relative globs | Makes either step kind apply when any changed path matches any selector. Omitted means unconditional. |
606
620
  | `afterReconcile` | repository: `true`; step: inherited | boolean | Step override wins over `[verify].afterReconcile`; false skips this step after reconciliation only. |
607
621
  | `always` | — | optional boolean | `true` makes the step unconditional and mandatory (a plan cannot deselect it); `false` is equivalent to omission. |
@@ -611,7 +625,7 @@ optional verification it warrants:
611
625
 
612
626
  ```toml
613
627
  +++
614
- verifySteps = ["types", "e2e"]
628
+ verifySteps = ["types", "acceptance"]
615
629
  +++
616
630
  ```
617
631
 
@@ -645,13 +659,13 @@ post-step follows the same rule.
645
659
 
646
660
  ```toml
647
661
  [verify]
648
- steps = ["e2e"]
662
+ steps = ["acceptance"]
649
663
 
650
- [verify.e2e]
664
+ [verify.acceptance]
651
665
  kind = "agent"
652
- skill = "verify-app-e2e" # repository-authored skill
666
+ skill = "verify-acceptance" # repository-authored skill
653
667
 
654
- [roles.e2e] # the STEP name — not "verify-app-e2e"
668
+ [roles.acceptance] # the STEP name — not "verify-acceptance"
655
669
  runtime = "pi"
656
670
  model = "openai-codex/gpt-5.6-sol"
657
671
  ```
@@ -760,11 +774,11 @@ rule an agent verify step follows, so one convention covers both:
760
774
 
761
775
  ```toml
762
776
  [verify]
763
- steps = ["e2e"]
777
+ steps = ["acceptance"]
764
778
 
765
- [verify.e2e]
779
+ [verify.acceptance]
766
780
  kind = "agent"
767
- skill = "verify-app-e2e" # repository-authored skill
781
+ skill = "verify-acceptance" # repository-authored skill
768
782
 
769
783
  [finalize]
770
784
  steps = ["release-notes"]
@@ -773,7 +787,7 @@ steps = ["release-notes"]
773
787
  kind = "agent"
774
788
  skill = "ab-release-notes"
775
789
 
776
- [roles.e2e] # verify STEP name — not "verify-app-e2e"
790
+ [roles.acceptance] # verify STEP name — not "verify-acceptance"
777
791
  runtime = "pi"
778
792
 
779
793
  [roles.release-notes] # finalize step name
@@ -1064,7 +1078,7 @@ keeps JSON stdout as one bare valid-ticket array. Tracker-wide safety checks
1064
1078
  remain fatal: the same id in two state dirs is a loud error naming both paths,
1065
1079
  as are root-level ticket files with no state and filesystem failures. When
1066
1080
  `dir` is defaulted, the backlog writes its own `.gitignore` of `*`, so git never sees it; an
1067
- explicit `dir` is the user's and is left alone. Agents and operators drive it
1081
+ explicit `dir` is the user's and is left alone. Operator agents and humans drive it
1068
1082
  through the source-agnostic `ab ticket` commands rather than running `mv` or
1069
1083
  `mkdir` by hand; `ab ticket state create` makes a new state.
1070
1084
 
@@ -1077,7 +1091,7 @@ environment variable instead and say why.
1077
1091
  ### `[orchestrator]`
1078
1092
 
1079
1093
  Gates the operator-agent feature (AUT-340, AUT-342): the persistent,
1080
- **credential-free** sandbox environment per operator × repository that an
1094
+ **credential-free** sandbox environment per session owner × repository that an
1081
1095
  operator agent drives through the `sandbox.*` registry tools (`ab mcp`, and
1082
1096
  every later binding), and — when the embedded orchestrator is enabled — the
1083
1097
  turn runner that answers operator sessions and wakes on build attention
@@ -1089,7 +1103,7 @@ changing it requires a dispatcher restart.
1089
1103
  | `enabled` | `false` | boolean | Master gate. With the table absent or `enabled = false`, the sandbox tools are absent from every binding, no environment is ever provisioned, and no dispatcher tick or message post ever runs orchestrator code — a local dispatcher is inert even when enabled, because the turn runner exists only in the hosted deployment. |
1090
1104
  | `model` | — (required when `enabled = true`) | nonblank provider-qualified string, same vocabulary as `[roles]` | The turn runner's model, resolved through the deployment's gateway credential; a leading `vercel-ai-gateway/` prefix is accepted and stripped. |
1091
1105
  | `invocationBudgetSeconds` | `240` | positive integer, clamped to 300 | Wall-clock budget for one turn invocation. A larger value is clamped — not rejected — to the 300-second hosted function limit the runner executes under. |
1092
- | `approvals` | `["builds.control:abort", "builds.control:discard", "builds.answer:revise-spec", "sandbox.publish", "tickets.move:ready"]` | array of `tool` or `tool:qualifier` strings | Registry tool calls that suspend a turn until the operator answers. Empty (`[]`) means none — autonomous operation. An entry naming an absent or unknown tool is **inert by design**, never an error. A qualified entry applies to one discriminator value only (`tickets.move:ready` approves moving a ticket to `ready`); for a tool without a discriminator, only the bare form matches. |
1106
+ | `approvals` | `["builds.control:abort", "builds.control:discard", "builds.answer:revise-spec", "sandbox.publish", "tickets.move:ready"]` | array of `tool` or `tool:qualifier` strings | Registry tool calls that suspend a turn until the human answers. Empty (`[]`) means none — autonomous operation. An entry naming an absent or unknown tool is **inert by design**, never an error. A qualified entry applies to one discriminator value only (`tickets.move:ready` approves moving a ticket to `ready`); for a tool without a discriminator, only the bare form matches. |
1093
1107
  | `wake` | inherits the default | array of event-type globs | The attention events a **new** session wakes for. Absent inherits the legacy hosted wake event set including `integration.verification-failed`, independent of CLI watch defaults; an explicit `[]` means never wake — message-only. Each glob must match at least one build event type. Existing sessions never retroactively inherit; an explicit wake update always wins. |
1094
1108
  | `sandbox` | — | strict subtable | The sandbox behavior knobs; absence reads as the defaults below. |
1095
1109
 
@@ -1110,8 +1124,8 @@ operator tools remain the only route to build state from inside the sandbox.
1110
1124
  Tool bounds an operator agent should know: `sandbox.exec` waits at most **300
1111
1125
  seconds**; stdout and stderr are each truncated at **65,536 bytes** with a
1112
1126
  `[truncated by autobuild: output exceeded 65536 bytes]` marker; `sandbox.reset`
1113
- and archiving an operator's last session are **destructive** (reset re-provisions
1114
- from the current base head); there is at most **one** environment per operator
1127
+ and archiving a session owner's last session are **destructive** (reset re-provisions
1128
+ from the current base head); there is at most **one** environment per session owner
1115
1129
  and repository.
1116
1130
 
1117
1131
  Publication: `sandbox.publish` takes a title (1–200 characters), an optional
@@ -1123,9 +1137,9 @@ recorded when the sandbox was provisioned or last reset — a pre-existing envir
1123
1137
  base head asks you to run `sandbox.reset` first. The rule is PR only, never the
1124
1138
  base branch: the sandbox itself never pushes and holds no credential — the push
1125
1139
  and the PR creation are kernel plumbing through the workspace provider's
1126
- publication capability, to one deterministic operator branch per operator and
1140
+ publication capability, to one deterministic operator branch per session owner and
1127
1141
  repository, so a later publish updates the same PR's head. A publication is a
1128
- repository-journal fact naming the operator, the session, the branch, the
1142
+ repository-journal fact naming the session owner (the `operator` field), the session, the branch, the
1129
1143
  commit, and the PR; a refused or failed attempt is journaled too.
1130
1144
 
1131
1145
  ### `[upgrade]`
@@ -1175,9 +1189,12 @@ repo path, needs no `AB_*` environment, and is safe to re-run. It:
1175
1189
  setup prompt for the user to run in a coding agent.
1176
1190
  - The setup agent inspects the repository, configures real commands and verify
1177
1191
  steps, independently chooses pipeline role runtimes/models, configures the
1178
- ticket source and environment-only credentials, arranges repository-specific
1179
- end-to-end verification (authoring a repository-owned agent verifier when
1180
- judgment is warranted), and files one groomed dispatchable ticket.
1192
+ ticket source and environment-only credentials, arranges
1193
+ an acceptance check through a repository-owned agent verify skill in every
1194
+ repository. Wire an existing maintained end-to-end or browser test suite into an ordinary `check` step. If none exists, do not create one during setup. The acceptance check neither substitutes for nor seeds a suite. It completes `bun ab init --validate`, fixing failures
1195
+ and reviewing warnings. The human then starts `bun ab dispatch` and opens
1196
+ their operator agent with `ab-operate` to create, groom, and shepherd the
1197
+ first ticket.
1181
1198
  - It never overwrites config once the file exists, even with `--force`; a rerun
1182
1199
  launches or prints a prompt that asks the agent to review and improve it.
1183
1200
  - Idempotently adds the exact `.autobuild/` rule to the target's `.gitignore`,
@@ -1277,7 +1294,7 @@ preserved through self-update handoff. If a replacement child receives the
1277
1294
  handoff marker without the pre-self-update baseline — possible when an older
1278
1295
  parent launches a newer child — it suppresses the entire automatic commit,
1279
1296
  names the cross-version compatibility reason, and leaves all upgrade-owned
1280
- changes uncommitted for the operator. Skill-upgrade results and the report's
1297
+ changes uncommitted for you. Skill-upgrade results and the report's
1281
1298
  existing exit code remain unchanged.
1282
1299
 
1283
1300
  Any content conflict, discovery conflict, pre-existing dirt in an owned path,
@@ -2392,7 +2409,7 @@ default, when you need to know what this repo's version says).
2392
2409
  | `ab-code-review` | `code-review` phase | Fresh skeptic: review the implementation diff against spec and plan, same verdict vocabulary. |
2393
2410
  | `ab-reconcile` | `reconcile` phase (epilogue) | Resolve a kernel-prepared single-change replay onto a frozen refreshed base; the kernel archives evidence and publishes with an exact expected-head guard. |
2394
2411
  | `ab-finalize` | `finalize` phase | Write the PR description for a green build; the kernel opens the PR. |
2395
- | `ab-operate` | outside the pipeline; model-invocable | The orchestrator role's operating manual, for any agent: file and groom tickets, watch builds with a resumable `ab watch` / `ab wait` loop, answer escalations, pause, resume, abort, control landing consent and holds, and keep going until every shepherded build is merged, closed, or aborted. Also read by the hosted turn runner as its system prompt (registry tools, approval and budget suspension, wake turns). |
2412
+ | `ab-operate` | outside the pipeline; model-invocable | The operator agent’s operating manual, for any agent: file and groom tickets, watch builds with a resumable `ab watch` / `ab wait` loop, answer escalations, pause, resume, abort, control landing consent and holds, and keep going until every shepherded build is merged, closed, or aborted. Also read by the hosted turn runner as its system prompt (registry tools, approval and budget suspension, wake turns). |
2396
2413
 
2397
2414
  Autobuild installs 12 skills. Everything except `ab-spec`, `ab-tickets`,
2398
2415
  `ab-guide`, and `ab-operate` carries `disable-model-invocation: true` — do not
@@ -2402,7 +2419,7 @@ description is exactly what the flag prevents. Those four exceptions drive no
2402
2419
  build phase, which is the criterion for membership (§16.3): `ab-spec` and
2403
2420
  `ab-tickets` are human/agent-facing pre-build surfaces, `ab-guide` is
2404
2421
  read-only reference including the setup handoff guidance, and `ab-operate` is
2405
- the manual for the orchestrator role, which any agent may take on.
2422
+ the manual for the operator-agent role, which any agent may take on.
2406
2423
 
2407
2424
  ## Revision-checked ticket writes
2408
2425
 
@@ -51,9 +51,9 @@ commands; see [owner workflow](setup.md#connected-projects).
51
51
 
52
52
  ## Operator sessions
53
53
 
54
- Operator sessions are the signed-in operator's durable orchestrator
54
+ Operator sessions are the signed-in user's durable orchestrator
55
55
  conversations: a hosted-only third store resource. A session
56
- belongs to the operator who created it; other operators of the same repository
56
+ belongs to the user who created it; other members of the same repository
57
57
  can read it and cannot write to it (`403 auth` on non-owner writes). Every
58
58
  write is attributed to the token's signed user — never a client-supplied
59
59
  identity — and carries no `via` marker: session events are the delegate's own
@@ -62,14 +62,14 @@ archived status is terminal.
62
62
 
63
63
  | Method and path | Result |
64
64
  |---|---|
65
- | `GET …/sessions` | The repository's session records, newest update first. Readable by any operator of the repository. |
66
- | `POST …/sessions` | `{"title"?:"…"}` → `201` + the created `SessionRecord`; the signed-in operator owns it. |
67
- | `GET …/sessions/{sid}` | `{session, state, turns}` where `state` is the reducer's derived state (`status`, `openTurn`, `pendingApproval`, `wakeGlobs`, `wakeCursors`, `turns`) and `turns` the ordered turn list. Readable by any operator of the repository. |
65
+ | `GET …/sessions` | The repository's session records, newest update first. Readable by any member of the repository. |
66
+ | `POST …/sessions` | `{"title"?:"…"}` → `201` + the created `SessionRecord`; the signed-in user owns it. |
67
+ | `GET …/sessions/{sid}` | `{session, state, turns}` where `state` is the reducer's derived state (`status`, `openTurn`, `pendingApproval`, `wakeGlobs`, `wakeCursors`, `turns`) and `turns` the ordered turn list. Readable by any member of the repository. |
68
68
  | `POST …/sessions/{sid}/messages` | `{"text":"…"}` → appends `message.posted`. Owner only. |
69
69
  | `PUT …/sessions/{sid}/wake` | `{"globs":["…"]}` (possibly empty) → appends `session.wake-set`. Owner only. |
70
70
  | `POST …/sessions/{sid}/approvals` | `{"turn":"…","toolCallId":"…","decision":"approve"\|"deny"}` → `approval.answered`. Owner only; `409 refusal` when the reduced state has no matching pending approval. |
71
71
  | `POST …/sessions/{sid}/archive` | Empty body → `session.archived`. Owner only; `409 refusal` when already archived. |
72
- | `GET …/sessions/{sid}/turns/{turn}/stream?since=N&wait=N` | The turn's stream read: `{chunks,status,outcome?,artifact?}` with `since` strictly greater-than and the same bounded-wait semantics as the stream protocol (whole seconds, clamped at 30). Unknown turn is `404 not-found`. Readable by any operator of the repository. |
72
+ | `GET …/sessions/{sid}/turns/{turn}/stream?since=N&wait=N` | The turn's stream read: `{chunks,status,outcome?,artifact?}` with `since` strictly greater-than and the same bounded-wait semantics as the stream protocol (whole seconds, clamped at 30). Unknown turn is `404 not-found`. Readable by any member of the repository. |
73
73
 
74
74
  Session state is a reduction of the session's event log, never a stored
75
75
  column; a `GET …/sessions/{sid}` response therefore always reflects the
@@ -257,12 +257,18 @@ record the first signal in the stop fact, and release its lease before exit.
257
257
 
258
258
  The default watch reports actionable conditions only:
259
259
 
260
+ - `integration.verification-failed`: failed node verification, once per prepared cycle, with failed steps, verified head and parent, and guidance to file a repair child targeting the node. Recovery reports only the latest prepared cycle while its head and parent remain current; superseded failures are not backfilled.
261
+
260
262
  - `build.janitor-failing`: a build has reached the configured consecutive-failure threshold; a successful janitor attempt clears it.
261
263
  - `dispatcher.forge-persistent`: forge degradation remains after a completed post-reset retry opportunity; successful recovery clears it.
262
264
 
263
- - Build `escalation.raised`, or `build.merge-decision`: a finalized open PR
264
- with auto-merge off or a current actionable merge-gate deferral. Armed consent
265
- awaiting application is silent. One merge decision is reported per build/PR.
265
+ - Build `escalation.raised`, `integration.landed`, `node.item-conflicted`, or
266
+ conflicted `restack.replayed` events. `build.consent-ready` is the single
267
+ signal for a ready consent or held landing, including first repository-wide
268
+ discovery. Its target has the queue entry shape `{kind, branch, ticket?, build?}`.
269
+ Unready and stale candidates stay silent. `build.merge-decision` remains for
270
+ current actionable merge-gate deferrals and unsafe forge outcomes, once per
271
+ build/PR; it does not duplicate consent or hold attention.
266
272
  - Repository `harvest.escalated`, `harvest.recovery-exhausted`,
267
273
  `dispatcher.config-rejected`, `dispatcher.config-reloaded` with nonempty
268
274
  `restartRequired`, `dispatcher.upgrade-failed`, `dispatcher.runtime-rolled-back`, abnormal `dispatcher.run-stopped`, and `dispatcher.lost`.
@@ -302,7 +308,9 @@ arming the watch. Named watches still end when every named build is terminal;
302
308
  learn their outcomes from status reconciliation at exit.
303
309
 
304
310
  `ab wait --for attention` is build-only and uses the same build conditions:
305
- an open escalation or a merge decision. Existing conditions return immediately,
311
+ current failed node verification, an open escalation, janitor failure attention,
312
+ consent readiness, landing/conflict attention or a merge decision. Current failed
313
+ verification satisfies attention even before its notification is written. Existing conditions return immediately,
306
314
  even with `--since`; live and backlog matches ignore routine outcomes and
307
315
  self-healing failures. A merge match uses the watch observation with
308
316
  `condition: "attention"`. Explicit `--event` globs remain event-only.