@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
@@ -0,0 +1,146 @@
1
+ ---
2
+ title: "Verification"
3
+ label: "Verification"
4
+ group: "concepts"
5
+ order: 6.5
6
+ description: "Configure verification gates, understand setup defaults, and collect evidence that your application meets its spec."
7
+ ---
8
+
9
+ # Verification
10
+
11
+ Verification runs after code review and before finalize. Review judges the code; verification proves what the built software does.
12
+
13
+ Every repository needs an **acceptance check**: an agent verify step that runs the built software, exercises each acceptance criterion in the spec, attaches evidence and returns a typed verdict. It isn't a test suite and leaves no test files.
14
+
15
+ - **Existing e2e or browser suite:** wire it in as an ordinary `check` step.
16
+ - **No suite:** don't create one; the acceptance check neither replaces nor seeds one.
17
+ - **Plans** prefer unit and integration tests at seams, adding e2e tests only where a suite exists or the spec asks.
18
+
19
+ ## Steps and outcomes
20
+
21
+ `[verify].steps` lists ordered `verify:*` steps, each configured in its own table.
22
+
23
+ | Kind | Runs | Outcome |
24
+ |---|---|---|
25
+ | `check` | a named `command` from `[commands]`, no agent | exit 0 passes; nonzero fails, keeping the output |
26
+ | `agent` | the exact `skill` you configure ([repository-local](skills.md#add-a-repository-local-skill), no prefix inferred) | `ab verdict` records pass, fail or skip |
27
+
28
+ - **Pass** advances to the next step.
29
+ - **Fail** sends the report back through implement and code review, then verification, up to `[policy].maxVerifyAttempts`; then the build escalates.
30
+ - **Skip** advances without counting as a pass or spending retries. Plan exclusions and path misses skip deterministically. An agent may skip only when the whole step doesn't apply, with a reason; an applicable behavior it can't exercise is a failure.
31
+
32
+ ## Select what a build needs
33
+
34
+ Plan selection applies first, then path applicability. Merge fragments like this into your configuration:
35
+
36
+ <!-- config-fragment:selection -->
37
+ ```toml
38
+ [commands]
39
+ typecheck = "bun tsc --noEmit"
40
+ test = "bun test"
41
+
42
+ [verify]
43
+ steps = ["types", "unit", "acceptance"]
44
+
45
+ [verify.types]
46
+ kind = "check"
47
+ command = "typecheck"
48
+ always = true
49
+
50
+ [verify.unit]
51
+ kind = "check"
52
+ command = "test"
53
+
54
+ [verify.acceptance]
55
+ kind = "agent"
56
+ skill = "verify-acceptance"
57
+ paths = ["web/**", "src/routes/**"]
58
+ ```
59
+
60
+ Substitute your own commands and acceptance skill.
61
+
62
+ A plan selects steps with TOML front matter:
63
+
64
+ <!-- plan-front-matter:selection -->
65
+ ```toml
66
+ +++
67
+ verifySteps = ["acceptance", "types"]
68
+ +++
69
+ ```
70
+
71
+ - `verifySteps` is the complete set, including every mandatory step. Execution keeps configuration order: types, then acceptance; unit is skipped.
72
+ - No front matter selects every step. An empty array is valid only when no step is mandatory.
73
+ - Unknown or duplicate names, malformed metadata and missing mandatory steps are rejected before the plan completes.
74
+
75
+ Path rules:
76
+
77
+ - `always = true` makes a step mandatory and bypasses path gating.
78
+ - Without `paths`, a step always applies. With `paths`, it applies when any build-owned changed path matches, including deletions and both sides of a rename.
79
+ - Globs are case-sensitive and repository-relative: literal segments, `*`, `?` and whole-segment `**`. No negation or absolute paths.
80
+ - After a reconcile, upstream-only changes don't count.
81
+ - A diff that can't be inspected is an infrastructure failure, never a skip.
82
+
83
+ After a reconcile, the `afterReconcile` policy applies before plan and path selection. By default it re-verifies; excluded steps are recorded as policy skips.
84
+
85
+ ## Route the verifier role
86
+
87
+ Agent steps route by step name, not skill name: [`[roles.acceptance]`](agent-runtimes.md#choosing-models) picks the agent for the `acceptance` step. Omitted `runtime` and `model` each inherit from the default role.
88
+
89
+ <!-- config-fragment:routing -->
90
+ ```toml
91
+ [verify]
92
+ steps = ["acceptance"]
93
+
94
+ [verify.acceptance]
95
+ kind = "agent"
96
+ skill = "verify-acceptance"
97
+
98
+ [roles.default]
99
+ runtime = "codex"
100
+ model = "gpt-6.1-sol"
101
+
102
+ [roles.acceptance]
103
+ runtime = "codex"
104
+ model = "gpt-6.1-sol"
105
+ ```
106
+
107
+ ## What initialization sets up
108
+
109
+ [`ab init`](getting-started.md#2-initialize-and-configure) writes a skeleton with empty commands and `steps = []`, which verifies nothing, then hands off to a setup agent.
110
+
111
+ The setup agent reads manifests, CI, tests and conventions, asks what it can't infer, and configures:
112
+
113
+ - real toolchain commands and an ordered verify chain, with no placeholders
114
+ - a repository-owned acceptance-check skill on an agent step, plus any existing e2e suite as a `check` step
115
+ - reproducible workspaces: locked dependencies, required system tools and an idempotent `[commands].setup` bootstrap, with remote tooling in [`[workspace.config].provisioning`](workspaces.md)
116
+ - for browser apps, a dependency-free `scripts/browser-smoke.sh` that starts the dev server, opens the page in headless Chromium (via a path such as `CHROMIUM_BIN`) and exits nonzero on failure
117
+
118
+ `bun ab init --validate` checks the environment, not your verify chain.
119
+
120
+ ## Make verification convincing
121
+
122
+ - **Order:** fast deterministic checks first.
123
+ - **Acceptance:** drive the built app through each criterion (create the resource, run the workflow, observe, clean up) with the narrowest flow that catches the regression.
124
+ - **Evidence:** for each criterion, record the criterion, action, observation and result. A failure includes reproduction inputs, expected and observed behavior, and native logs. Give passing screenshots, reports and recordings stable artifact kinds so later attempts replace them.
125
+ - **Scope:** verifiers don't review style or fix code. See [adding a repository-local skill](skills.md#add-a-repository-local-skill).
126
+
127
+ A **docs-drift verifier** is another useful pattern: it reports published-doc passages that a build's behavior changes no longer match. Autobuild doesn't ship one; this repository's `docs` step is one.
128
+
129
+ ## Worked example: this repository
130
+
131
+ Autobuild's own chain: this repository's choices, not defaults.
132
+
133
+ | # | Step | Kind | What it does |
134
+ |---|---|---|---|
135
+ | 1 | lint | check | formatting and lint; mandatory |
136
+ | 2 | types | check | TypeScript type checking |
137
+ | 3 | unit | check | the test suite |
138
+ | 4 | postgres | check | live store, service and migration suites, plus hosted-service packaging; mandatory |
139
+ | 5 | dashboard | agent | captures terminal-dashboard frames and judges them |
140
+ | 6 | web-dashboard | agent | captures operator web-app frames and judges them against the design |
141
+ | 7 | website | agent | captures site and docs frames at desktop and phone widths, compared with approved references |
142
+ | 8 | docs | agent | fails when a `docs/` passage no longer matches the build's user-facing changes |
143
+
144
+ Steps 5 to 8 are optional and path-scoped, run by repository skills `ab-verify-dashboard`, `verify-web-dashboard`, `verify-website` and `verify-docs`. The docs step applies to product source, skills, templates, `SPEC.md`, `README.md` and `docs/`. The terminal verifier's `ab-` prefix is legacy; local skills get plain names.
145
+
146
+ A plan for a docs change like this page selects lint, types, unit, postgres, website and docs; both of the last two pass their path checks because they cover `docs/`. The untouched dashboard steps aren't selected.
package/docs/website.md CHANGED
@@ -1,14 +1,56 @@
1
1
  # Website
2
2
 
3
- The marketing site is one static page in `packages/website`, reproduced from the approved design in `design/website/`. The package is private and never published to npm.
3
+ The marketing site and multi-page evaluator documentation are static HTML in `packages/website`, reproduced from the approved design in `design/website/`. The package is private and never published to npm.
4
4
 
5
5
  - `bun run website:dev` serves it on port 3300 (`PORT` overrides), rebuilding on every request.
6
- - `bun run website:build` writes `packages/website/dist/` (`index.html`, `site.css`, `site.js`).
6
+ - `bun run website:build` writes `packages/website/dist/` (`index.html`, `site.css`, `site.js`, `og.png`, and generated `docs/**/index.html`).
7
7
 
8
- The hero is the real `ab dispatch` dashboard: `packages/website/src/hero-frame.txt` holds the exact colored lines the terminal dashboard painted for the scripted `website-hero` capture, and the page renders them as preformatted HTML with each terminal color mapped to its design token. `bun run capture:website-hero` regenerates the file from the capture, and `bun run check` fails when it is stale.
8
+ Public docs are authored in `docs/*.md`, with opt-in YAML frontmatter:
9
9
 
10
- Shared links preview through Open Graph and Twitter card tags in the page head, pointing at `og.png`, a 1200×630 card drawn from the same frame in the site's own styles. `bun run capture:website-og` screenshots it with a local Chromium into `packages/website/src/og.png`; rerun it after changing the headline, the hero frame, or the styles, and look at the result, since font rasterization differs between machines and nothing checks the bytes. The canonical origin every absolute URL is built from is `SITE_URL` in `packages/website/src/constants.ts`.
10
+ ```yaml
11
+ ---
12
+ title: Example page
13
+ group: guides
14
+ order: 10
15
+ description: What you will learn.
16
+ # Optional short nav label and route override:
17
+ label: Example
18
+ slug: example
19
+ ---
20
+
21
+ # Example page
22
+ ```
23
+
24
+ The opening h1 must match `title` and is consumed into the existing page layout.
25
+ Groups sort as `start`, `concepts`, `guides`, `reference`, then by numeric `order`
26
+ and filename. The filename stem is the default slug; `slug: ""` selects `/docs/`.
27
+ Routes use `/docs/<slug>/` and emit directory indexes. Slugs contain lowercase
28
+ letters, digits and single hyphens. Metadata and route collisions fail the build.
29
+ Files without frontmatter are reference-only and never published, including
30
+ `docs/website.md` and the dispatcher cutover and sandbox rollout probes.
31
+
32
+ Use relative Markdown links such as `[Builds](builds.md#one-build)` so GitHub
33
+ resolves them. The generator maps links to published files to their site routes,
34
+ preserving queries and fragments; reference-only Markdown targets link to GitHub.
35
+ Missing Markdown targets fail the build. External links and same-page anchors
36
+ stay as written. Keep article text in Markdown, not in website TypeScript.
37
+
38
+ Build and dev requests discover pages afresh; adding a file requires no website
39
+ registry edit. `bun run capture:website` captures every generated docs page at
40
+ 1440px and 390px, plus interaction states; inspect the PNGs and report under
41
+ `.ab/website-frames/`. Static hosts must serve directory index files. The dev
42
+ server redirects slashless docs URLs to canonical trailing-slash paths.
43
+
44
+ `bun run check` enforces complete-byte parity for same-named files shared by
45
+ `docs/` and `skills/guide/references/`, including their live and pristine installed
46
+ copies. Edit docs first and synchronize all three guide copies in the same
47
+ commit. Publication metadata is part of those bytes; guide-only references do
48
+ not need a public counterpart.
49
+
50
+ The hero opens on the getting-started commands: the headline and lead, then the install, `ab init`, `ab dispatch` and `/ab-spec` command block that the page repeats in its closing section, then the Documentation and GitHub links. The homepage no longer renders a dashboard frame. `packages/website/src/hero-frame.txt` still holds the exact colored lines the terminal dashboard painted for the scripted `website-hero` capture, and it now backs only the Open Graph card below. `bun run capture:website-hero` regenerates the file from the capture, and `bun run check` fails when it is stale.
51
+
52
+ Shared links preview through Open Graph and Twitter card tags in each page head, pointing at `og.png`, a 1200×630 card drawn from the same frame in the site's own styles. `bun run capture:website-og` screenshots it with a local Chromium into `packages/website/src/og.png`; rerun it after changing the headline, the hero frame, or the styles, and look at the result, since font rasterization differs between machines and nothing checks the bytes. The canonical origin every absolute URL is built from is `SITE_URL` in `packages/website/src/constants.ts`.
11
53
 
12
54
  `dist/` is plain static files: any static host can serve it with no server runtime, credentials, or environment variables. On Vercel, set the root directory to `packages/website`, the build command to `bun run build`, and the output directory to `dist`.
13
55
 
14
- The page loads one webfont from Google Fonts and makes no other third-party requests.
56
+ Each page loads one webfont from Google Fonts and makes no other third-party requests.
@@ -0,0 +1,152 @@
1
+ ---
2
+ title: "Workspaces"
3
+ group: "reference"
4
+ description: "Provision local git worktrees or Vercel Sandboxes, handle private repositories, and implement a workspace provider."
5
+ label: "Workspaces"
6
+ order: 15
7
+ ---
8
+
9
+ # Workspaces
10
+
11
+ ## Responsibility
12
+
13
+ A workspace provider provisions a writable working copy on the requested branch, records its base, resumes it and releases it; a remote provider can also supply execution and trusted publication. Agents commit locally. The kernel owns pushes, forge operations and lifecycle transitions; guests never get the host's publication authority.
14
+
15
+ ## Shipped adapters
16
+
17
+ Install with `bun add -d --exact @defrex/autobuild`. Examples are complete `autobuild.toml` files; adapt commands, provider and model.
18
+
19
+ ### Git worktree (`git-worktree`)
20
+
21
+ The default, for builds on your own machine. Needs Git, a writable repository and scratch location, and your runtime and check tools on the host. No workspace credential.
22
+
23
+ <!-- seam-config:start -->
24
+ ```toml
25
+ forge = "local-git"
26
+
27
+ [tickets]
28
+ source = "file"
29
+ readyState = "ready"
30
+
31
+ [commands]
32
+ setup = "bun install --frozen-lockfile"
33
+
34
+ [workspace]
35
+ provider = "git-worktree"
36
+ ```
37
+ <!-- seam-config:end -->
38
+
39
+ Run `bun ab init`, install and authenticate your runtime, then run `bun ab init --validate`.
40
+
41
+ - **Isolation.** Each build gets its own directory and branch over the shared Git object database. Files are isolated; host processes, network and credentials aren't.
42
+ - **No options.** No `[workspace.config]` and no provisioning; system packages must already be on the host.
43
+ - **Resume.** Intact reprovision keeps uncommitted work; a lost directory is rebuilt from branch and publication evidence, never a newer base.
44
+ - **Release** is idempotent and removes the working copy, not the forge branch.
45
+
46
+ ### Vercel Sandbox (`vercel-sandbox`)
47
+
48
+ Runs build-runners, agents and checks on remote machines. Install `@defrex/autobuild-vercel-sandbox`, register it in `plugins`, and commit your setup and configuration so remote clones see them. Requires:
49
+
50
+ - an HTTPS hosted BuildStore
51
+ - an HTTPS `github.com/owner/repository` origin and `forge = "github"`
52
+ - a push-capable `GITHUB_TOKEN` or `GH_TOKEN` on the dispatcher (a `gh` login isn't enough)
53
+ - `VERCEL_TOKEN`, `VERCEL_TEAM_ID` and `VERCEL_PROJECT_ID` on the dispatcher host
54
+
55
+ A short-lived `VERCEL_OIDC_TOKEN` (`vercel link`, `vercel env pull`) works only if it outlives the operation; long-running dispatchers need durable tokens. See [Vercel SDK authentication](https://vercel.com/docs/sandbox/sdk-reference).
56
+
57
+ <!-- seam-config:start -->
58
+ ```toml
59
+ forge = "github"
60
+ plugins = ["@defrex/autobuild-vercel-sandbox"]
61
+
62
+ [store]
63
+ url = "https://builds.example.com"
64
+
65
+ [tickets]
66
+ source = "hosted"
67
+ teamKey = "ENG"
68
+
69
+ [commands]
70
+ setup = "bun install --frozen-lockfile"
71
+
72
+ [workspace]
73
+ provider = "vercel-sandbox"
74
+
75
+ [workspace.config]
76
+ image = "vercel/sandbox/universal:latest"
77
+ vcpus = 4
78
+ timeoutSeconds = 2700
79
+ environmentVariables = ["AI_GATEWAY_API_KEY"]
80
+ provisioning = [
81
+ { name = "system-install", command = "apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y jq" },
82
+ { name = "system-preflight", command = "jq --version" },
83
+ ]
84
+ gitUsernameEnv = "AB_GIT_READ_USER"
85
+ gitPasswordEnv = "AB_GIT_READ_TOKEN"
86
+
87
+ [workspace.config.runtimeProvisioning.pi]
88
+ install = "npm install --global --ignore-scripts @earendil-works/pi-coding-agent@0.84.4"
89
+ preflight = "test \"$(pi --version)\" = \"0.84.4\" && pi update --models"
90
+
91
+ [roles.default]
92
+ runtime = "pi"
93
+ model = "vercel-ai-gateway/anthropic/claude-sonnet-4.6"
94
+ ```
95
+ <!-- seam-config:end -->
96
+
97
+ Connect the project:
98
+
99
+ ```sh
100
+ bun ab connect https://builds.example.com
101
+ ```
102
+
103
+ Tickets and Store share a service here but are selected independently. The Pi route needs `AI_GATEWAY_API_KEY`; the pinned version illustrates reproducible provisioning, not a recommendation.
104
+
105
+ Sandbox preparation order:
106
+
107
+ 1. checkout and pinned Bun verification
108
+ 2. `provisioning` steps, in order, as root
109
+ 3. dependencies
110
+ 4. `runtimeProvisioning.<runtime>` installs
111
+ 5. `commands.setup`
112
+
113
+ - **Runtimes.** Every primary and alternate runtime needs a pinned install and exact-version preflight, and gets only the credentials named in `environmentVariables`; subscription logins aren't copied.
114
+ - **Repetition.** New sandboxes repeat provisioning and preflights rerun before each build-runner; keep setup idempotent.
115
+ - **Validation.** `bun ab init --validate` runs named provisioning, setup, runtime and Store checks in a disposable environment, deletes it even on failure, and starts no build or agent.
116
+ - **Lifetime.** `timeoutSeconds` bounds a sandbox; provider operations have their own timeouts. An intact sandbox resumes; an expired or lost one is rebuilt from durable workspace and publication evidence, losing unpublished work that lived only on it.
117
+
118
+ ### Private repositories
119
+
120
+ The Sandbox example names a read-only clone identity. Set it on the dispatcher host, outside TOML:
121
+
122
+ ```sh
123
+ export AB_GIT_READ_USER='x-access-token'
124
+ export AB_GIT_READ_TOKEN='<read-only repository token>'
125
+ ```
126
+
127
+ - Use a repository-scoped read token, separate from the push identity. For a public clone, remove `gitUsernameEnv` and `gitPasswordEnv`.
128
+ - Autobuild passes these as the authenticated Git source for [Vercel private-repository cloning](https://vercel.com/kb/guide/sandbox-private-github-repositories); don't embed credentials in the origin URL.
129
+ - `environmentVariables` is only for runtime API credentials. Never forward `AB_TOKEN`, `GITHUB_TOKEN`, `GH_TOKEN`, Vercel tokens or the clone token; Autobuild supplies scoped Store authority, keeps clone secrets out of guest commands, and publishes from the host.
130
+
131
+ ## Writing your own
132
+
133
+ Implement `WorkspaceProvider`, register its factory in `workspaceProviders`, and select it with `workspace.provider`. Import from `@defrex/autobuild/plugin-sdk`; [Writing a plugin](plugin-authoring.md) covers loading, capabilities and publishing.
134
+
135
+ A provider must:
136
+
137
+ - return an absolute, writable path on the requested branch, with durable selected-base evidence
138
+ - preserve commits and uncommitted files on intact reprovision
139
+ - rematerialize a lost copy from surviving branch and publication evidence, not a moving base
140
+ - release idempotently
141
+ - never overwrite unknown unpublished work
142
+
143
+ Test with a `WorkspaceProviderContractFactory` returning a `WorkspaceProviderContractHarness` (provider, provision request, expected base, a real fixture file, cleanup). Run `describeWorkspaceProviderContract` unchanged, or expose the fixture in the plugin's contract descriptor:
144
+
145
+ ```sh
146
+ bun ab plugin test workspace-provider acme
147
+ ```
148
+
149
+ The suite certifies only the basic working copy. Remote execution adds trusted start/observe/stop, durable identity and recovery, readiness, credential delegation and publication readback; read the [shared remote capability requirements](plugin-authoring.md) first, and declare only what you implement:
150
+
151
+ - Publication reports confirmed SHA and cache tips and supports the required guarded rewrites.
152
+ - Store grants go through the host's `delegateCredential` callback; never serialize host tokens into execution identity.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defrex/autobuild",
3
- "version": "1.0.0-beta.4",
3
+ "version": "1.0.1",
4
4
  "description": "Agent-driven software delivery from groomed ticket to merged PR",
5
5
  "repository": {
6
6
  "type": "git",
@@ -126,7 +126,8 @@
126
126
  "capture:website-og": "bun tools/website-og.ts",
127
127
  "release": "bun tools/release.ts",
128
128
  "postgres:migrate": "bun packages/postgres-store/src/bin.ts migrate",
129
- "check": "bun tools/biome-check.ts && bun tools/product-name-check.ts && bun tools/docs-asset-check.ts && bun tools/skill-docs-asset-check.ts && bun tools/readme-headline.ts --check && bun tools/website-hero.ts --check && bun tools/workspace-manifest-check.ts && bun tools/package-boundary-check.ts && bun tools/bin-mode-check.ts && bun tools/publish-contents-check.ts && bun tools/publish-imports-check.ts",
129
+ "docs:configuration": "bun tools/configuration-reference.ts --write",
130
+ "check": "bun tools/biome-check.ts && bun tools/product-name-check.ts && bun tools/docs-asset-check.ts && bun tools/configuration-reference.ts --check && bun tools/docs-reference-sync.ts && bun tools/docs-integrity-check.ts && bun tools/skill-docs-asset-check.ts && bun tools/readme-headline.ts --check && bun tools/website-hero.ts --check && bun tools/workspace-manifest-check.ts && bun tools/package-boundary-check.ts && bun tools/bin-mode-check.ts && bun tools/publish-contents-check.ts && bun tools/publish-imports-check.ts",
130
131
  "format:staged": "git-format-staged --formatter './node_modules/.bin/biome format --stdin-file-path {}' '*.js' '*.jsx' '*.ts' '*.tsx' '*.json' '*.jsonc' '*.css' '*.graphql' '*.gql'",
131
132
  "prepare": "husky",
132
133
  "test": "bun test packages/*/src tools bin packages/hosted-store-service/app",
@@ -144,8 +145,8 @@
144
145
  },
145
146
  "devDependencies": {
146
147
  "@biomejs/biome": "2.5.5",
147
- "@defrex/autobuild-postgres-store": "1.0.0-beta.4",
148
- "@defrex/autobuild-vercel-sandbox": "1.0.0-beta.4",
148
+ "@defrex/autobuild-postgres-store": "1.0.1",
149
+ "@defrex/autobuild-vercel-sandbox": "1.0.1",
149
150
  "@resvg/resvg-js": "2.6.2",
150
151
  "@types/bun": "^1.3.14",
151
152
  "@types/node": "^24.0.0",
@@ -37,7 +37,7 @@ export interface CliEnv {
37
37
 
38
38
  export type AmbientReadSession = CliEnv | HarvestCliEnv
39
39
 
40
- const PHASE_FORMAT = "'<phase>[@<round>]' (e.g. 'implement@2', 'verify:e2e@1')"
40
+ const PHASE_FORMAT = "'<phase>[@<round>]' (e.g. 'implement@2', 'verify:acceptance@1')"
41
41
  const BUILD_AMBIENT_TUPLE = 'AB_STORE/AB_BUILD/AB_PHASE/AB_SESSION'
42
42
  const HARVEST_AMBIENT_TUPLE = 'AB_STORE/AB_REPO/AB_HARVEST/AB_PHASE/AB_SESSION'
43
43
 
@@ -51,7 +51,9 @@ export const HELP_CATALOG: readonly HelpEntry[] = [
51
51
  'On an interactive terminal, init selects a usable shipped runtime in a fixed product',
52
52
  'preference order and starts a conversational setup agent. The agent inspects the',
53
53
  'repository, asks for team-specific choices, configures commands, verification, roles,',
54
- 'and tickets, and leaves one groomed ticket. Its exit status becomes init’s exit status.',
54
+ 'and tickets, then validates with bun ab init --validate. Its exit status becomes init’s exit status.',
55
+ 'After validation, you start bun ab dispatch, then open your operator agent with',
56
+ 'ab-operate to create, groom, and shepherd the first ticket.',
55
57
  'Without a usable runtime or interactive terminal, init completes installation, prints',
56
58
  'every probe result, and emits the identical setup prompt for use in a coding agent.',
57
59
  '',
@@ -808,7 +810,7 @@ export function renderTopLevelHelp(): string {
808
810
  const lines = [
809
811
  'ab — agent-driven software delivery from groomed ticket to merged PR',
810
812
  '',
811
- '`ab` is Autobuild’s human/operator CLI and the agent↔store channel (SPEC §8.2).',
813
+ '`ab` serves the operator role (normally an operator agent, or you directly) and the agent↔store channel (SPEC §8.2).',
812
814
  '',
813
815
  'Primary human workflow:',
814
816
  ' Install in your repository: bun add -d --exact @defrex/autobuild',
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod'
2
+ import { documentFields } from './reference-metadata'
2
3
 
3
4
  /** Ordered dispatcher-owned policy; omitted predicates are wildcards. */
4
5
  export const landingRuleSchema = z.strictObject({
@@ -20,3 +21,10 @@ export const landingRuleSchema = z.strictObject({
20
21
  mode: z.enum(['auto', 'consent']),
21
22
  })
22
23
  export type LandingRule = z.infer<typeof landingRuleSchema>
24
+
25
+ documentFields(landingRuleSchema, {
26
+ into: 'Optional destination: `root`, any `node`, or an exact frozen destination node ticket id.',
27
+ from: 'Restrict this rule to one source build kind; omission matches all kinds.',
28
+ label: 'Optional exact, case-sensitive label on the source ticket. Blank labels are invalid.',
29
+ mode: 'Choose automatic landing or require recorded consent.',
30
+ })
@@ -0,0 +1,31 @@
1
+ import type { z } from 'zod'
2
+
3
+ /** Documentation describes input semantics; it never participates in validation. */
4
+ export interface ReferenceMetadata {
5
+ description?: string
6
+ constraints?: string
7
+ required?: string
8
+ examples?: string[]
9
+ structure?:
10
+ | { kind: 'map'; value: z.ZodType; keys: string }
11
+ | { kind: 'steps'; steps: z.ZodType; table: z.ZodType; afterReconcile?: z.ZodType }
12
+ }
13
+ const registry = new WeakMap<z.ZodType, ReferenceMetadata>()
14
+ export function referenceMetadata(schema: z.ZodType): ReferenceMetadata | undefined {
15
+ return registry.get(schema)
16
+ }
17
+ export function documentSchema<T extends z.ZodType>(schema: T, metadata: ReferenceMetadata): T {
18
+ registry.set(schema, { ...registry.get(schema), ...metadata })
19
+ return schema
20
+ }
21
+ /** A description map is deliberately not an inventory: traversal reads the schema. */
22
+ export function documentFields(schema: z.ZodObject, descriptions: Record<string, string>): void {
23
+ for (const [key, description] of Object.entries(descriptions)) {
24
+ const field = schema.shape[key]
25
+ if (!field)
26
+ throw new Error(
27
+ `Configuration reference metadata names an unknown field: ${key}. Remove its obsolete description, then regenerate with bun run docs:configuration.`,
28
+ )
29
+ documentSchema(field, { description })
30
+ }
31
+ }