@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
package/docs/seams.md ADDED
@@ -0,0 +1,66 @@
1
+ ---
2
+ title: "Infrastructure seams"
3
+ group: "reference"
4
+ description: "Choose stores, agent runtimes, forges, workspaces, and ticket sources, and understand where local and remote execution run."
5
+ label: "Seams"
6
+ order: 7
7
+ ---
8
+
9
+ # Infrastructure seams
10
+
11
+ Adapters supply storage, agent execution, code publication, workspaces and tickets. You choose each independently: a remote database doesn't move computation to a remote machine.
12
+
13
+
14
+ ## Storage and tickets
15
+
16
+ - **BuildStore.** Local SQLite with filesystem artifacts by default; a Postgres adapter, exposed over the network by the hosted HTTP service.
17
+ - **Tickets.** Local files, Linear, or hosted tickets. A hosted Store doesn't require hosted tickets.
18
+
19
+ See [Build store](build-store.md) and [Tickets](ticket-sources.md).
20
+
21
+
22
+ ## Agents, code, and workspaces
23
+
24
+ - **Agent runtimes.** Claude Code, Codex and Pi. Roles choose runtime and model.
25
+ - **Forges.** GitHub and local git. Remote setups need GitHub.
26
+ - **Workspaces.** Local git worktrees, or Vercel Sandbox machines for runners, agents and checks.
27
+
28
+ Every environment needs the runtime, tools, dependencies and credentials; remote ones also need reproducible provisioning. See [Workspaces](workspaces.md).
29
+
30
+
31
+ ## What runs where
32
+
33
+ | Piece | All local | All remote |
34
+ |---|---|---|
35
+ | Dispatcher | your machine | hosted, scheduled, origin-mode configuration |
36
+ | Build runners, agents, checks | your machine, in git worktrees | Vercel Sandbox |
37
+ | Store | local SQLite | hosted Store on Postgres |
38
+ | Tickets | file or any other source | a remote ticket source |
39
+ | Forge | local git or GitHub | GitHub |
40
+ | Operator access | terminal dashboard and local CLI | browser or MCP connector |
41
+
42
+ - File tickets and local git make all-local independent of GitHub.
43
+ - The operator agent is external in both.
44
+ - Choosing Postgres alone doesn't make anything remote.
45
+ - Mixed deployments work within adapter constraints, e.g. a local dispatcher with a hosted Store and remote sandboxes.
46
+
47
+ See [Dispatcher hosting](dispatcher-hosting.md).
48
+
49
+
50
+ ## Extend the boundaries
51
+
52
+ - **Plugin modules** register ticket sources, agent runtimes, workspace providers and forges. See [Writing a plugin](plugin-authoring.md).
53
+ - **BuildStores** implement the storage or remote protocol contract, not a plugin registration.
54
+ - **Verify and finalize steps** and editable skills extend repository behavior; the phases stay fixed. See [Configuration](configuration-overview.md).
55
+ - **Hosting and operator surfaces** are deployment choices, not plugin ports.
56
+
57
+ ## Seam guides
58
+
59
+ - [Tickets](ticket-sources.md): file, Linear, hosted, ticket trees.
60
+ - [Agent runtimes](agent-runtimes.md): Claude Code, Codex, Pi, models.
61
+ - [Workspaces](workspaces.md): git worktree, Vercel Sandbox, provisioning.
62
+ - [Forges](forges.md): GitHub, local git, publication adapters.
63
+ - [Build store](build-store.md): SQLite, Postgres, HTTP, contracts.
64
+ - [Dispatcher hosting](dispatcher-hosting.md): local processes, scheduled hosted ticks.
65
+ - [Operator surfaces](operator-surfaces.md): terminal, web, CLI, MCP.
66
+ - [Writing a plugin](plugin-authoring.md): modules, contracts, packaging, publishing.
package/docs/setup.md CHANGED
@@ -115,17 +115,19 @@ exits nonzero on failure. Then:
115
115
  alternate. The runtime that launched setup and the temporary fresh-skeleton
116
116
  default do not constrain the final arrangement.
117
117
  3. Choose the ticket source and workflow states. Confirm account/team facts and
118
- required environment credentials. Configure end-to-end verification with the
119
- repository's real lifecycle and tools. When judgment is required, author a repository-owned
120
- agent-verify skill and select it from an agent verify step.
118
+ required environment credentials. Author a repository-owned acceptance-check skill and select it from an agent
119
+ verify step in every repository. An **acceptance check** is a repository-owned agent verify step that runs the built software, exercises each acceptance criterion in the spec, attaches evidence, and returns a typed verdict. Every repository must configure one. It is not a test suite and leaves no test files behind.
120
+ 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.
121
121
  4. Preserve an existing `autobuild.toml` and unrelated repository choices on a
122
122
  rerun. Change only choices the maintainer approves.
123
123
  5. Commit the config, setup files, lockfiles, and installed reference changes,
124
124
  then push them to `baseBranch`. A remote sandbox clones the authoritative
125
125
  GitHub revision; it cannot acquire local-only edits.
126
126
  6. Run `ab init --validate`. Fix every named failure, review warnings and unknowns, and rerun
127
- validation. Only then use the installed grooming/ticket skills to create the
128
- first groomed Ready ticket and start `ab dispatch`.
127
+ validation. Setup ends at successful validation. Ask the human to start
128
+ `bun ab dispatch`, then open their coding agent at the repository root with
129
+ `ab-operate` loaded to specify, create, groom, and shepherd the first ticket.
130
+ The setup agent must not start dispatch itself.
129
131
 
130
132
  Validation is explicit and noninteractive. It does not dispatch, claim a
131
133
  ticket, or create build, phase, session, event, transcript, or artifact history.
@@ -554,7 +556,7 @@ without the optional readiness capability report UNKNOWN and need an adapter
554
556
  upgrade; local Git passes these hosted-policy checks trivially.
555
557
 
556
558
  Known hard failures make `ab init --validate` exit unsuccessfully. Warnings and
557
- unknowns preserve the workspace validation result and require operator review.
559
+ unknowns preserve the workspace validation result and require your review.
558
560
  Dispatch reports known hard failures once per invocation as durable
559
561
  `dispatcher.forge-readiness-failed` repository notices without adding an admission
560
562
  gate. External orchestrators follow these through `ab watch` with no slugs or an
package/docs/skills.md ADDED
@@ -0,0 +1,119 @@
1
+ ---
2
+ title: "Skills"
3
+ label: "Skills"
4
+ group: "concepts"
5
+ order: 6
6
+ description: "Understand Autobuild's agent skills, customize their defaults for your repository, and keep your edits through upgrades."
7
+ ---
8
+
9
+ # Skills
10
+
11
+ Skills guide the agents that plan, implement, review and operate Autobuild, one per phase or role. They supply judgment; code owns build state, transitions, gates and publication.
12
+
13
+ ## Strong defaults, yours to edit
14
+
15
+ `ab init` installs the shipped skills as repository files under `.agents/skills/ab-<name>/`: a `SKILL.md` plus optional references or scripts. For example, tell `.agents/skills/ab-implement/SKILL.md` to use the shared database adapter, follow the existing error vocabulary and run the project's integration checks.
16
+
17
+ - Change how agents work, not the lifecycle's gates. Keep each skill's typed CLI contract: context, notes deposit and completion command.
18
+ - Commit edits so every agent shares them.
19
+ - Edit the live tree, never its pristine baseline.
20
+
21
+ ## The shipped skills
22
+
23
+ | Skill | Purpose |
24
+ |---|---|
25
+ | `ab-spec` | Groom intent into a ticket spec with you; not a spec-phase session |
26
+ | `ab-plan` | Plan the implementation from the spec |
27
+ | `ab-plan-review` | Check the plan against the spec independently |
28
+ | `ab-implement` | Execute the approved plan and commit |
29
+ | `ab-code-review` | Review the implementation against the contract independently |
30
+ | `ab-finalize` | Write the pull request description after verification |
31
+ | `ab-reconcile` | Resolve conflicts in a kernel-prepared replay onto a refreshed base |
32
+ | `ab-operate` | External operator agent: file tickets, watch builds, answer escalations, control landing |
33
+ | `ab-tickets` | Read, create, groom and update tickets through the tracker interface |
34
+ | `ab-harvest` | Turn claimed observations into ticket proposals |
35
+ | `ab-harvest-review` | Review those proposals independently |
36
+ | `ab-guide` | Reference for the system, configuration, setup and installed skills |
37
+
38
+ - **Phase skills** (plan through reconcile) are runner-invoked; don't start them manually.
39
+ - **Spec, ticket and operator skills** work outside the pipeline. Observation harvest is a separate repository workflow.
40
+ - **No generic agent verifier ships.** Your repository supplies its own evidence and checks.
41
+
42
+ ## How upgrades preserve customization
43
+
44
+ Init records upstream files under `.agents/skills/.ab-pristine/ab-<name>/`, a tracked baseline rather than an editable copy. `ab upgrade` three-way merges every distributed file, supporting files included:
45
+
46
+ - **Base:** the pristine copy
47
+ - **Local:** your file
48
+ - **Incoming:** the new upstream default
49
+
50
+ Overlapping edits get an agent resolution biased toward your customization, validated to preserve clean regions, add no conflict markers and keep frontmatter identity.
51
+
52
+ On success, pristine advances to the incoming upstream bytes, not the merged result, so your edits stay visible to the next upgrade. New upstream support files are added. Removed upstream files are deleted if unedited; customized copies stay as repository-local files.
53
+
54
+ ### Reading the upgrade report
55
+
56
+ Each skill reports the aggregate of its files; `conflicted` outranks `resolved`, `merged`, `adopted` and `current`.
57
+
58
+ | Outcome | Meaning |
59
+ |---|---|
60
+ | `current` | Upstream unchanged; the local file stands |
61
+ | `adopted` | Incoming bytes adopted, pristine advanced; also restoring a missing live file, adding a support file, or deleting an unedited upstream-removed one |
62
+ | `merged` | Independent changes combined, pristine advanced; also a customized upstream-removed support file, kept and released from pristine |
63
+ | `resolved` | Local-biased agent resolution passed validation; pristine advanced to incoming |
64
+ | `conflicted` | Resolution unavailable, failed, declined as ambiguous, or invalid. Live and pristine untouched while other files advance; no conflict markers in the live skill |
65
+ | `installed` | Missing from both live and pristine trees; installed fresh |
66
+ | `removed` | Eligible retired skill's unchanged tree and owned discovery link removed, or a missing tree's obsolete provenance and dangling owned link cleaned up |
67
+ | `kept` | Retired skill customized, configured or unsafe to remove, or a user-owned Claude discovery entry preserved while the canonical tree went; obsolete pristine ownership cleared |
68
+ | `unknown` | `ab-*` name not in the distribution; left alone. Not license to use the reserved prefix |
69
+
70
+ **No pristine record:**
71
+
72
+ - absent local file: installed
73
+ - local file identical to incoming: becomes the baseline
74
+ - differing local file: `conflicted`, not overwritten; merge by hand against the reported pristine path
75
+
76
+ **Retirement** (`removed`, `kept`) applies only to `ab-setup` and `ab-verify-e2e`, and only with a pristine record proving Autobuild provenance; a same-named repository skill without one is left alone. A retired skill is kept when an agent verify or finalize step uses it or its configuration can't be inspected safely. Obsolete ownership is then cleared, so the skill doesn't return or get reported again.
77
+
78
+ **Exit status.**
79
+
80
+ - **Discovery collisions fail.** A distinct real directory or foreign symlink at `.claude/skills/<name>` is preserved (symlinks keep their exact target text), reported, and exits nonzero, even when a retired canonical tree is removed.
81
+ - **Content conflicts don't.** `conflicted` results alone, including timeouts and cancelled resolution, exit zero. Read the report, not just the exit code.
82
+
83
+ **Commit.** A conflict-free upgrade makes a local commit limited to upgrade-owned changes; `--no-commit` leaves them to you. Conflicts or unsafe Git state suppress the commit with an explanation. See [Upgrading](upgrading.md).
84
+
85
+ ## Add a repository-local skill
86
+
87
+ `ab-` is reserved for shipped skills. Give yours plain names, such as `.agents/skills/verify-acceptance/SKILL.md` with a name, description and instructions. Application-specific evidence requirements belong there.
88
+
89
+ Every repository needs an **acceptance check**: a repository-owned agent verify step that exercises each acceptance criterion against the built software. It isn't a test suite and leaves no test files. Its skill tells the agent to:
90
+
91
+ 1. Run `ab context` and read the materialized inputs.
92
+ 2. Gather the evidence the skill defines as a pass or failure.
93
+ 3. Report `pass`, `fail` or `skip` through `ab verdict`; its prose response isn't the result.
94
+
95
+ Select the skill by exact name (no prefix is inferred), appending `acceptance` to your existing steps:
96
+
97
+ ```toml
98
+ [verify]
99
+ steps = ["acceptance"]
100
+
101
+ [verify.acceptance]
102
+ kind = "agent"
103
+ skill = "verify-acceptance"
104
+ ```
105
+
106
+ [Verification](verification.md#steps-and-outcomes) covers step kinds and outcomes.
107
+
108
+ ## Harness discovery
109
+
110
+ Codex and Pi read `.agents/skills/` directly. Claude Code reads `.claude/skills/`, where init links each shipped skill to its canonical directory, so there's one editable copy. Link a new local skill from the repository root:
111
+
112
+ ```sh
113
+ mkdir -p .claude/skills
114
+ ln -s ../../.agents/skills/verify-acceptance .claude/skills/verify-acceptance
115
+ ```
116
+
117
+ - **Check first.** If `.claude/skills/` and `.agents/skills/` already alias the same directory, skip per-skill links.
118
+ - **Don't overwrite** existing user-owned directories or foreign links; resolve collisions deliberately.
119
+ - **Commit** the skill and its link together.
@@ -0,0 +1,132 @@
1
+ ---
2
+ title: "Tickets"
3
+ group: "reference"
4
+ description: "Configure file, Linear, or hosted tickets and implement a ticket-source adapter."
5
+ label: "Ticket sources"
6
+ order: 13
7
+ ---
8
+
9
+ # Tickets
10
+
11
+ ## Responsibility
12
+
13
+ A ticket source owns ticket CRUD, lifecycle transitions, claiming, labels, blockers and creation identity. The build's pinned spec, history, transcripts and artifacts live in the BuildStore; editing a ticket after claim doesn't replace the pinned spec. See [Tickets are the interface](tickets.md) for grooming and the ready gate.
14
+
15
+ ## Shipped adapters
16
+
17
+ Install with `bun add -d --exact @defrex/autobuild`. Examples are complete minimal `autobuild.toml` files. Credentials go in the dispatcher environment or an ignored `.env`, never TOML.
18
+
19
+ | Source | Choose it for | Credential |
20
+ |---|---|---|
21
+ | `file` | tickets you edit as plain files | none |
22
+ | `linear` | a team already grooming in Linear | `LINEAR_API_KEY` |
23
+ | `hosted` | a project tracker shared by agents and clients | saved `ab connect` credential |
24
+
25
+ ### Local files (`file`)
26
+
27
+ Tickets live in a writable directory, `.autobuild/tickets/` by default; the default follows a local Store root and stays local with a remote Store. An explicit `dir` resolves from the repository root and isn't git-ignored automatically.
28
+
29
+ <!-- seam-config:start -->
30
+ ```toml
31
+ [tickets]
32
+ source = "file"
33
+ dir = ".tickets"
34
+ readyState = "ready"
35
+ readyLabels = []
36
+ createState = "triage"
37
+ triageState = "triage"
38
+ proposalState = "triage"
39
+ doneState = "done"
40
+ ```
41
+ <!-- seam-config:end -->
42
+
43
+ - **States are directories** (`.tickets/ready/`, `.tickets/doing/`). Claims move to `doing`; `claimedState` isn't configurable.
44
+ - **Claiming** needs `readyState`, every `readyLabels` entry and resolved blockers; `[]` adds no label gate.
45
+
46
+ Initialize with `bun ab init`; manage with `bun ab ticket states` and the other ticket commands.
47
+
48
+ ### Linear (`linear`)
49
+
50
+ Export a personal API key from [Linear's API setup](https://linear.app/developers/graphql) as `LINEAR_API_KEY` on the dispatcher host. It needs team access and must read issues, teams, workflow states, labels and dependencies, and write issues, comments, labels and blocking relationships.
51
+
52
+ <!-- seam-config:start -->
53
+ ```toml
54
+ [tickets]
55
+ source = "linear"
56
+ teamKey = "ENG"
57
+ readyState = "Todo"
58
+ readyLabels = ["autobuild"]
59
+ claimedState = "In Progress"
60
+ createState = "Backlog"
61
+ triageState = "Backlog"
62
+ proposalState = "Backlog"
63
+ doneState = "Done"
64
+ ```
65
+ <!-- seam-config:end -->
66
+
67
+ Replace `ENG` and the case-sensitive workflow names with your team's.
68
+
69
+ - **Admission.** `teamKey` selects the team; `readyState`, every `readyLabels` entry and optional `readyAssignee` filter it.
70
+ - **Labels.** `readyLabels` defaults to `["autobuild"]`; `[]` removes the gate.
71
+ - **No `project` key.** Scope the queue through team access, states and labels.
72
+ - **Rate limits** are shared with your other API callers.
73
+
74
+ ### Hosted (`hosted`)
75
+
76
+ An independent tracker (not a Linear proxy) that works with local builds too. Connect the project:
77
+
78
+ ```sh
79
+ bun ab connect --tickets https://tickets.example.com
80
+ ```
81
+
82
+ The saved credential authorizes ticket operations and policy publication.
83
+
84
+ <!-- seam-config:start -->
85
+ ```toml
86
+ [tickets]
87
+ source = "hosted"
88
+ teamKey = "ENG"
89
+ url = "https://tickets.example.com"
90
+ readyState = "ready"
91
+ readyLabels = []
92
+ claimedState = "doing"
93
+ createState = "triage"
94
+ triageState = "triage"
95
+ proposalState = "triage"
96
+ doneState = "done"
97
+ ```
98
+ <!-- seam-config:end -->
99
+
100
+ - `teamKey` identifies the registered project's team.
101
+ - **URL.** `tickets.url` defaults to the remote BuildStore service (`AB_STORE` or `[store].url`); it's required with a local Store, as here.
102
+ - **Authority.** A separate ticket service needs its own project credential; a Store connection grants nothing there. Delegated child sessions are read-only and can't redefine policy.
103
+
104
+ ### Optional ticket tree
105
+
106
+ All three sources declare `integrationTree: true`, storing kind and target as frontmatter (`file`), transactional project data (`hosted`), or the exact `node` label plus the parent relationship (`linear`).
107
+
108
+ - **Targets** resolve to canonical ids in the same source and pick the integration destination, not execution order; blockers are a separate graph. See [integration](integration-overview.md).
109
+ - **Updates.** Omitted `kind` or `target` keeps the value. New tickets default to work; `kind = "work"` resets kind; `target = null` clears a target in the typed API (not TOML syntax).
110
+ - **Validation.** Target existence, node kind, self/ancestor cycles, corrupt ancestor chains and demoting a node with children are checked before any write; invalid metadata rejects the whole patch.
111
+ - **Enumeration.** `listAll` lists every state, ignoring ready filters.
112
+ - **Without the capability**, a source keeps CRUD but must refuse kind/target writes, not drop them.
113
+
114
+ ## Writing your own
115
+
116
+ Implement `TicketSource`, register it in the manifest's `ticketSources` map, and select it with `tickets.source`. Import from `@defrex/autobuild/plugin-sdk`, never internal paths. [Writing a plugin](plugin-authoring.md) covers factories, registration and publishing.
117
+
118
+ An adapter must:
119
+
120
+ - preserve lifecycle, claim and blocker-completion semantics
121
+ - create idempotently under retries, with stable visible creation keys
122
+ - return valid records from `listReady` with diagnostics for malformed ones, but propagate infrastructure failures
123
+ - declare revision support honestly: guarded writes reject stale revisions; unsupported guards fail explicitly
124
+ - never report success for a partial mixed update
125
+
126
+ Test with a `TicketSourceContractFactory` returning a `TicketSourceContractHarness` (source, lifecycle states, a writable fixture label, cleanup). Live fixtures reserve creation keys before creating, so cleanup survives a lost response. Run `describeTicketSourceContract` unchanged, or expose the fixture through the plugin contract descriptor and run:
127
+
128
+ ```sh
129
+ bun ab plugin test ticket-source acme
130
+ ```
131
+
132
+ Declare tree support only if you keep the [optional tree contract](plugin-authoring.md#optional-ticket-tree-capability) on the same port and harness: exhaustive pagination, canonical targets, revision coverage and atomic rejection.
@@ -0,0 +1,69 @@
1
+ ---
2
+ title: "Tickets and specs"
3
+ group: "concepts"
4
+ description: "How your operator agent writes buildable specs, chooses ticket kinds, and grooms work for the ready gate."
5
+ label: "Tickets and specs"
6
+ order: 5
7
+ ---
8
+
9
+ # Tickets and specs
10
+
11
+ A ticket says what change to make and why. The tracker is the input; the build's pinned spec is the execution contract.
12
+
13
+
14
+ ## Choose a source
15
+
16
+ Autobuild ships three ticket sources; plugins can register more through the same port:
17
+
18
+ - **File** stores tickets in lifecycle directories.
19
+ - **Linear** (direct) uses your team's workflow.
20
+ - **Hosted** is its own project-scoped service, not a Linear proxy.
21
+
22
+ The source supplies content, workflow states, labels, and blockers; configuration picks the source and ready gate. Everything else is source-agnostic.
23
+
24
+ ```toml
25
+ [tickets]
26
+ source = "file"
27
+ readyState = "ready"
28
+ ```
29
+
30
+ See [Ticket sources](ticket-sources.md) for setup, credentials, configuration and extension contracts.
31
+
32
+ ## Groom a buildable spec
33
+
34
+ The spec standard asks for:
35
+
36
+ - **What and why.** The observable change and why it matters; implementation strategy is left to planning.
37
+ - **Acceptance criteria.** Verifiable facts that decide whether the work is done.
38
+ - **Out of scope.** Adjacent work the build must leave alone.
39
+ - **Evidence.** The decision, incident, data, or observations behind the request.
40
+
41
+ Your operator agent grooms the ticket with you using `ab-spec`, then moves it to the ready state with any required labels. Dispatch's spec gate returns ready tickets that can't become conforming specs to Triage with an explanation.
42
+
43
+
44
+ ## Ready is a gate, not a guarantee
45
+
46
+ The dispatcher claims only tickets in the ready state with the required labels and any source-specific filter. A ready ticket still waits on:
47
+
48
+ - **Blockers.** Unresolved prerequisite tickets keep it queued; they don't create a blocked build. With nodes, prerequisites with builds must be present at the sampled destination; see [integration and blocker presence](integration-overview.md).
49
+ - **Destination and capacity.** Its target must accept new work, and a capacity slot must be free.
50
+
51
+ At dispatch, Autobuild pins the spec, so later tracker edits don't change what reviewers approved. A deliberate revision goes through your operator agent answering an escalation, and restarts planning:
52
+
53
+ ```sh
54
+ bun ab answer <slug> --revise-spec-from-ticket
55
+ ```
56
+
57
+
58
+ ## Work and node tickets
59
+
60
+ | Kind | Describes | Runs |
61
+ |---|---|---|
62
+ | Work | an individual change | the build pipeline |
63
+ | Node | a finite integration point | collects related work, verifies it together, lands into its parent |
64
+
65
+ Both kinds need conforming specs; a node's intent alone isn't a buildable contract. Set the kind with `ab ticket create` or `ab ticket update --kind work|node`. See [integrating related work](integration-overview.md) for targets, node admission and landing.
66
+
67
+ Outside signals and agent discoveries enter through [Intake and harvest](intake.md) as proposals, groomed before they become ready work.
68
+
69
+ Follow the [dispatcher guide](dispatcher.md) for what happens at claim, or [Getting started](getting-started.md) for a first ticket.
@@ -0,0 +1,111 @@
1
+ ---
2
+ title: Troubleshooting
3
+ group: reference
4
+ order: 18
5
+ description: "Diagnose configuration, idle dispatch, authentication, stalled builds, and project selection."
6
+ ---
7
+
8
+ # Troubleshooting
9
+
10
+ Start from the symptom and recorded state. Your operator agent inspects the CLI and suggests fixes; you manage dispatcher processes and credentials.
11
+
12
+ ## Invalid configuration
13
+
14
+ **Symptom.** Startup reports a TOML syntax error, invalid config with field paths, or a runtime-routing error naming a role.
15
+
16
+ **Cause.** Malformed TOML, misplaced fields, inconsistent step definitions, or runtime and model settings inherited from `roles.default`.
17
+
18
+ **Fix**, in order:
19
+
20
+ 1. Repair TOML syntax.
21
+ 2. Fix every schema path the error names in `autobuild.toml`.
22
+ 3. Give each listed step a matching subtable and existing command names.
23
+ 4. Inspect the merged default and child roles; each setting inherits independently.
24
+ 5. Pick a supported model with `bun ab models` or the plugin's documentation.
25
+
26
+ ```sh
27
+ bun ab models --available
28
+ bun ab init --validate
29
+ ```
30
+
31
+ `bun ab dispatch --once` runs real work; use it only for a real tick.
32
+
33
+ ## tick: idle with expected work
34
+
35
+ **Symptom.** Plain dispatch prints `tick: idle` while you expect a ticket or harvest to start.
36
+
37
+ **Cause.** An admission or workflow gate is closed.
38
+
39
+ **Fix.** Inspect state, then check the gates:
40
+
41
+ ```sh
42
+ bun ab repository status
43
+ bun ab builds --queued
44
+ bun ab harvest status
45
+ ```
46
+
47
+ - **Intake and pause:** intake on, repository not paused. Resume a deliberately paused repository only when work should proceed.
48
+ - **Ready state:** ticket in the exact ready state with every required label.
49
+ - **Blockers and destination:** blockers done, target node open, required changes in the destination.
50
+ - **Claims:** claimed tickets aren't reclaimed.
51
+ - **Capacity:** paused or blocked work keeps its slot; idle collecting nodes take none. Node verification and reconciliation account specially for descendants' slots.
52
+ - **Harvest:** check the acknowledged harvest gate and unclaimed observations. Harvest triggers at `policy.harvestThreshold` observations, or `policy.harvestMaxDrift` other merged builds since the oldest observation (zero disables drift), and uses no build slot.
53
+
54
+ ## Authentication failures
55
+
56
+ **Symptom.** Ticket requests, forge operations, agent launches or hosted reads report missing or rejected credentials. Each service has its own credential and scope.
57
+
58
+ | Component | Check |
59
+ |---|---|
60
+ | Linear | `LINEAR_API_KEY`, team and workflow states, in the actual process environment or supported `.env` |
61
+ | GitHub | `gh auth status` and repository permissions; test Git fetch and push separately |
62
+ | Agent providers | The effective role's runtime: `codex login` when the Codex diagnostic asks; for Pi, provider login and the provider-qualified model |
63
+ | Hosted store | `bun ab connect` for service, project and credential status |
64
+
65
+ - **Provider refusals.** Fix permission, billing and quota failures on the provider side.
66
+ - **Hosted credentials.** Reconnect on the affected host and user when saved credentials are missing or rejected. `AB_STORE` and `AB_TOKEN` override the saved store URL and credential. Build and session grants have narrower authority.
67
+
68
+ [Build store](build-store.md#shipped-adapters) covers saved credentials and store-selection precedence. Keep secrets out of diagnostic reports.
69
+
70
+ ## Stuck or wedged builds
71
+
72
+ **Symptom.** A build stops advancing, often after an interruption.
73
+
74
+ **Cause.** Escalated, paused, waiting on landing gates, starting a runner, or recovering an expired lease. A quiet log isn't a crash.
75
+
76
+ **Fix.** Inspect the build, reading status, progress and lease health separately:
77
+
78
+ ```sh
79
+ bun ab build status my-build
80
+ bun ab builds --queued
81
+ ```
82
+
83
+ - **Held lease:** something owns the build live.
84
+ - **Old progress:** nothing recent was recorded.
85
+ - **Absent lease:** often a runner still starting.
86
+ - **Expired lease on actionable work:** the lease sweep recovers it. A merged or closed PR may instead be waiting on completion bookkeeping.
87
+
88
+ | State | Action |
89
+ |---|---|
90
+ | Cleanly paused | `bun ab resume my-build` |
91
+ | Open escalation | `bun ab answer my-build "guidance"`, or a retry resolution from `bun ab help answer` |
92
+ | Process recovery needed | You stop and drain the dispatcher cleanly, then restart it |
93
+
94
+ - A restart doesn't clear escalation gates.
95
+ - Terminal builds can't restart, and abort is irreversible.
96
+
97
+ See [answering blocked builds](operating.md#answer-and-pause). Preserve event logs; let the kernel manage leases and recovery.
98
+
99
+ ## Hosted project selection
100
+
101
+ **Symptom.** A project is missing from connected tools or the dashboard, or hosted dispatch ignores it despite valid credentials.
102
+
103
+ **Cause.** Registration, allowed-user access, project credentials and dispatcher selection are separate gates.
104
+
105
+ - **Registration.** Check the active PostgreSQL project registry; build or ticket data doesn't register a project.
106
+ - **Access.** Every allowlisted user sees all active entries; verify sign-in separately from credentials.
107
+ - **Administration.** With deployment database credentials, an administrator runs `ab-hosted-store projects list`, `projects add` or `projects remove`. Mutations require `--user IDENTITY` for attribution; project tokens can't administer registrations.
108
+ - **Dispatcher selection.** `AB_DISPATCHER_REPOSITORIES` in the hosted dispatch environment selects projects: unset selects every active registration; an explicit ordered list is intersected with current registrations.
109
+ - **Dashboard fallback.** With no selection, the dashboard shows the first registered origin.
110
+
111
+ Registry errors fail closed.
@@ -0,0 +1,50 @@
1
+ ---
2
+ title: Upgrading
3
+ group: reference
4
+ order: 17
5
+ description: "Update the pinned installation, preserve customization, and resume durable work."
6
+ ---
7
+
8
+ # Upgrading
9
+
10
+ Autobuild is an exact pinned development dependency. Pin the release you intend and review manifest and lockfile together.
11
+
12
+ ## Update the installation
13
+
14
+ Stop the dispatcher cleanly first and let its sessions drain or suspend. Your operator agent diagnoses the need; you manage the process.
15
+
16
+ From the project that owns the installation, replacing `VERSION`:
17
+
18
+ ```sh
19
+ bun add -d --exact @defrex/autobuild@VERSION
20
+ bun ab upgrade --no-self-update
21
+ ```
22
+
23
+ - **Self-update.** Plain `bun ab upgrade` updates a recognized installation on its distribution channel, then merges skills and applies supported migrations with the new distribution. An unsupported installation reports why it skipped. `--no-self-update` skips only the installation update.
24
+ - **Two scopes.** Package and lockfile changes belong to the project that owns the installation; skill merges and config migrations apply to the target repository, which can differ.
25
+
26
+ Check what upgrade committed, then review and commit the version bump.
27
+
28
+ ## Review configuration and skills
29
+
30
+ Upgrade keeps your `autobuild.toml`; supported migrations may amend it.
31
+
32
+ - **Explicit landing policy:** a valid policy stays byte-for-byte unchanged.
33
+ - **Absent landing policy:** upgrade reads the target repository's journal. Legacy ON becomes leaf auto; OFF or no fact becomes leaf consent; nodes get consent either way. If the journal is unavailable, restore access or configure policy deliberately, then retry.
34
+
35
+ Skills [merge three ways](skills.md#how-upgrades-preserve-customization), with validated agent resolutions for overlapping edits. An unresolved conflict leaves that file untouched while others advance. Read the [upgrade report](skills.md#how-upgrades-preserve-customization) and diff even after exit zero: content conflicts don't fail the command. A conflict-free upgrade makes a narrowly scoped local commit. With `--no-commit`, conflicts or unsafe Git state, edits stay uncommitted with an explanation; resolve the reported files and commit.
36
+
37
+ ## Restart and resume
38
+
39
+ Restart with the upgraded repository-installed CLI:
40
+
41
+ ```sh
42
+ bun ab dispatch
43
+ ```
44
+
45
+ - **One writer.** Don't run old and new dispatchers at once.
46
+ - **Durable resume.** Work resumes from durable state after a clean stop. Restart doesn't answer escalations.
47
+ - **Old behavior.** Drain old work before switching if it must keep the old execution behavior; no claim-version switch preserves it.
48
+ - **Hosted services.** Upgrade the hosted service before its connected projects, within its compatibility window.
49
+
50
+ Read [Infrastructure seams](seams.md) and [Repository configuration](configuration-overview.md) before changing infrastructure or landing policy.