@defrex/autobuild 0.14.0 → 1.0.0-beta.0
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.
- package/README.md +4 -2
- package/SPEC.md +654 -98
- package/docs/architecture.md +226 -5
- package/docs/assets/headline-wide.png +0 -0
- package/docs/configuration.md +112 -12
- package/docs/hosted-service.md +18 -0
- package/docs/integration-tree.md +117 -0
- package/docs/landing-policy.md +150 -0
- package/docs/mcp.md +24 -0
- package/docs/migration-1.0.md +68 -0
- package/docs/operator-api.md +19 -8
- package/docs/remote-store-protocol.md +30 -7
- package/docs/remote-ticket-protocol.md +26 -5
- package/docs/restacking.md +79 -0
- package/docs/setup.md +49 -6
- package/docs/ticket-dependencies.md +69 -0
- package/docs/ticket-migration.md +8 -0
- package/package.json +3 -3
- package/packages/core/src/cli/attention.ts +25 -2
- package/packages/core/src/cli/build-control.ts +65 -41
- package/packages/core/src/cli/context.ts +54 -2
- package/packages/core/src/cli/dashboard/actions.ts +6 -3
- package/packages/core/src/cli/dashboard/landing-display.ts +6 -0
- package/packages/core/src/cli/dashboard/live.ts +5 -0
- package/packages/core/src/cli/dashboard/model.ts +142 -18
- package/packages/core/src/cli/dashboard/poll.ts +15 -9
- package/packages/core/src/cli/dashboard/refresh.ts +176 -0
- package/packages/core/src/cli/dashboard/render.ts +78 -28
- package/packages/core/src/cli/dashboard/repository-poll.ts +57 -0
- package/packages/core/src/cli/dashboard/selection.ts +7 -1
- package/packages/core/src/cli/dashboard/tree.ts +107 -0
- package/packages/core/src/cli/dispatch-frontend.ts +156 -109
- package/packages/core/src/cli/dispatch.ts +250 -136
- package/packages/core/src/cli/dispatcher-liveness.ts +15 -2
- package/packages/core/src/cli/help.ts +49 -32
- package/packages/core/src/cli/init-validation.ts +43 -2
- package/packages/core/src/cli/keyboard.ts +6 -0
- package/packages/core/src/cli/landings.ts +18 -0
- package/packages/core/src/cli/main.ts +49 -15
- package/packages/core/src/cli/mcp.ts +9 -0
- package/packages/core/src/cli/publication-settlement.ts +168 -2
- package/packages/core/src/cli/repository-status.ts +11 -0
- package/packages/core/src/cli/status.ts +72 -5
- package/packages/core/src/cli/terminal-restore.ts +54 -0
- package/packages/core/src/cli/terminal.ts +16 -2
- package/packages/core/src/cli/terminals.ts +98 -79
- package/packages/core/src/cli/ticket-editor.ts +10 -3
- package/packages/core/src/cli/ticket.ts +113 -18
- package/packages/core/src/cli/upgrade-commit.ts +4 -0
- package/packages/core/src/cli/upgrade-compatibility.ts +2 -2
- package/packages/core/src/cli/upgrade-landing.ts +69 -0
- package/packages/core/src/cli/upgrade.ts +16 -0
- package/packages/core/src/cli/wait.ts +115 -19
- package/packages/core/src/cli/watch.ts +51 -12
- package/packages/core/src/config/landing.ts +22 -0
- package/packages/core/src/config/live.ts +1 -0
- package/packages/core/src/config/schema.ts +3 -0
- package/packages/core/src/events/catalog.ts +48 -3
- package/packages/core/src/events/payloads.ts +295 -6
- package/packages/core/src/events/repository.ts +31 -0
- package/packages/core/src/integration/harness.ts +10 -0
- package/packages/core/src/kernel/__snapshots__/reducer-registry.test.ts.snap +1030 -239
- package/packages/core/src/kernel/auto-merge-default.ts +1 -0
- package/packages/core/src/kernel/auto-merge.ts +12 -3
- package/packages/core/src/kernel/build-identity.ts +94 -0
- package/packages/core/src/kernel/change-presence.ts +179 -0
- package/packages/core/src/kernel/dispatch-status.ts +17 -1
- package/packages/core/src/kernel/engine.ts +89 -2
- package/packages/core/src/kernel/generators/build-log.ts +23 -0
- package/packages/core/src/kernel/generators/leaf-restack-log.ts +110 -0
- package/packages/core/src/kernel/generators/node-restack-log.ts +94 -0
- package/packages/core/src/kernel/generators/repository-journals.ts +11 -0
- package/packages/core/src/kernel/integration-completeness.ts +81 -0
- package/packages/core/src/kernel/integration-landing.ts +263 -0
- package/packages/core/src/kernel/integration-stack.ts +36 -0
- package/packages/core/src/kernel/integration-state.ts +135 -0
- package/packages/core/src/kernel/landing-policy.ts +47 -0
- package/packages/core/src/kernel/landing-publication.ts +41 -0
- package/packages/core/src/kernel/landing-readiness.ts +67 -0
- package/packages/core/src/kernel/landing-state.ts +96 -0
- package/packages/core/src/kernel/leaf-restack-completion.ts +24 -0
- package/packages/core/src/kernel/leaf-restack-state.ts +73 -0
- package/packages/core/src/kernel/log-index.ts +35 -5
- package/packages/core/src/kernel/node-landing.ts +439 -0
- package/packages/core/src/kernel/node-parent.ts +184 -0
- package/packages/core/src/kernel/node-restack-state.ts +191 -0
- package/packages/core/src/kernel/node-restack-transaction.ts +210 -0
- package/packages/core/src/kernel/node-restack.ts +274 -0
- package/packages/core/src/kernel/read-facts.ts +70 -3
- package/packages/core/src/kernel/reconcile-head.ts +51 -0
- package/packages/core/src/kernel/reconcile-restack.ts +560 -0
- package/packages/core/src/kernel/reducer-registry.ts +16 -0
- package/packages/core/src/kernel/reducer.ts +121 -6
- package/packages/core/src/kernel/snapshot-parent.ts +33 -0
- package/packages/core/src/ontology.ts +9 -1
- package/packages/core/src/operator/annotations.ts +12 -0
- package/packages/core/src/operator/control.ts +6 -0
- package/packages/core/src/operator/index.ts +4 -0
- package/packages/core/src/operator/landings.ts +35 -0
- package/packages/core/src/operator/presentation.ts +1 -0
- package/packages/core/src/operator/protocol.ts +12 -3
- package/packages/core/src/operator/query.ts +3 -1
- package/packages/core/src/operator/registry.ts +48 -19
- package/packages/core/src/operator/requests.ts +1 -8
- package/packages/core/src/operator/tickets.ts +55 -9
- package/packages/core/src/ports/forge/contract.ts +91 -3
- package/packages/core/src/ports/forge/fake.ts +142 -4
- package/packages/core/src/ports/forge/git-rewrite.ts +232 -0
- package/packages/core/src/ports/forge/github-readiness.ts +421 -0
- package/packages/core/src/ports/forge/github.ts +631 -35
- package/packages/core/src/ports/forge/local-git.ts +119 -5
- package/packages/core/src/ports/forge/readiness.ts +99 -0
- package/packages/core/src/ports/tickets/contract.ts +41 -0
- package/packages/core/src/ports/tickets/create.ts +8 -1
- package/packages/core/src/ports/tickets/fake.ts +32 -1
- package/packages/core/src/ports/tickets/file-codec.ts +7 -0
- package/packages/core/src/ports/tickets/file.ts +18 -1
- package/packages/core/src/ports/tickets/hosted-index.ts +2 -0
- package/packages/core/src/ports/tickets/linear.ts +124 -4
- package/packages/core/src/ports/tickets/migration.ts +25 -1
- package/packages/core/src/ports/tickets/operations.ts +7 -2
- package/packages/core/src/ports/tickets/remote-protocol.ts +19 -0
- package/packages/core/src/ports/tickets/remote.ts +10 -1
- package/packages/core/src/ports/tickets/revision.ts +3 -1
- package/packages/core/src/ports/tickets/tree.ts +148 -0
- package/packages/core/src/ports/tickets/update.ts +15 -2
- package/packages/core/src/ports/types.ts +135 -5
- package/packages/core/src/ports/workspace/git-worktree.ts +2 -1
- package/packages/core/src/ports/workspace/provider-capabilities.ts +1 -1
- package/packages/core/src/ports/workspace/vercel-sandbox.ts +60 -3
- package/packages/core/src/processes/build-runner.ts +530 -23
- package/packages/core/src/processes/dispatcher-selectors.ts +15 -9
- package/packages/core/src/processes/dispatcher.ts +2145 -203
- package/packages/core/src/processes/execution-no-progress.ts +46 -1
- package/packages/core/src/processes/publication-state.ts +30 -5
- package/packages/core/src/processes/repo-view.ts +21 -2
- package/packages/core/src/store/build-scope.ts +18 -0
- package/packages/core/src/store/contract.ts +658 -0
- package/packages/core/src/store/digest.ts +52 -4
- package/packages/core/src/store/local/schema.ts +25 -13
- package/packages/core/src/store/local/store.ts +117 -1
- package/packages/core/src/store/memory.ts +62 -1
- package/packages/core/src/store/phase-session.ts +17 -0
- package/packages/core/src/store/reduced-reads.ts +2 -1
- package/packages/core/src/store/reducer-value-shapes.json +10707 -6440
- package/packages/core/src/store/remote/client.ts +44 -0
- package/packages/core/src/store/remote/compatibility.ts +19 -9
- package/packages/core/src/store/remote/protocol.ts +11 -0
- package/packages/core/src/store/repo-state-events.ts +2 -0
- package/packages/core/src/store/session-handle.ts +15 -0
- package/packages/core/src/store/subscribe.ts +1 -1
- package/packages/core/src/store/types.ts +32 -4
- package/packages/core/src/testing/index.ts +2 -0
- package/packages/core/src/testing/reduced-read-budget.ts +48 -8
- package/packages/core/src/testing/refresh-scheduler.ts +32 -0
- package/skills/guide/SKILL.md +110 -61
- package/skills/guide/references/integration-tree.md +117 -0
- package/skills/guide/references/landing-policy.md +150 -0
- package/skills/guide/references/migration-1.0.md +68 -0
- package/skills/guide/references/operator-api.md +12 -5
- package/skills/guide/references/plugin-authoring.md +34 -0
- package/skills/guide/references/remote-store-protocol.md +30 -7
- package/skills/guide/references/remote-ticket-protocol.md +26 -5
- package/skills/guide/references/restacking.md +79 -0
- package/skills/guide/references/setup.md +49 -6
- package/skills/guide/references/ticket-dependencies.md +69 -0
- package/skills/guide/references/ticket-migration.md +8 -0
- package/skills/operate/SKILL.md +55 -5
- package/skills/reconcile/SKILL.md +55 -48
- package/skills/spec/SKILL.md +67 -1
- package/skills/tickets/SKILL.md +55 -2
- package/templates/autobuild.toml +3 -0
package/docs/architecture.md
CHANGED
|
@@ -230,6 +230,11 @@ the requested historical run. A never-started fresh invocation does not request
|
|
|
230
230
|
historical correlation. Stopped dispatcher history is not copied into every
|
|
231
231
|
current read.
|
|
232
232
|
|
|
233
|
+
Hosted project build listings use the optional backing-store
|
|
234
|
+
`listBuildsForRepo` capability with the authenticated repository. Postgres filters
|
|
235
|
+
build rows in SQL before hosted ticket readable-id projection. Admin listings
|
|
236
|
+
remain global; adapters without the capability retain application filtering.
|
|
237
|
+
|
|
233
238
|
**Operator and CLI reads.** Build listings and details, repository and Harvest
|
|
234
239
|
status, dispatcher decisions, operator API queries, MCP delegation and web
|
|
235
240
|
dashboard refreshes use the same typed persisted read helpers. Shared projection
|
|
@@ -365,7 +370,7 @@ selection (applied at the planner's `ab done` in `packages/core/src/cli/terminal
|
|
|
365
370
|
snapshotted by the engine at approval), and
|
|
366
371
|
`packages/core/src/kernel/verify-applicability.ts` matches changed paths against a step's
|
|
367
372
|
selectors, resolved by the build runner via `git diff` against the initial
|
|
368
|
-
branch-cut base (or the
|
|
373
|
+
branch-cut base (or the effective base promoted by successful restack/reconcile publication).
|
|
369
374
|
This verify-only base is deliberately independent from implementation's
|
|
370
375
|
focused review range. All narrowing mechanisms produce the ordinary
|
|
371
376
|
queryable skipped outcome; Git failure is infrastructure and fails closed,
|
|
@@ -537,6 +542,17 @@ receive-pack-free network policy, so even a failed publication-policy restore
|
|
|
537
542
|
fails closed before setup or plugin code runs. Normal VM sessions never receive
|
|
538
543
|
Forge credentials.
|
|
539
544
|
|
|
545
|
+
**Forge readiness.** `ports/forge/readiness.ts` owns the portable check inventory,
|
|
546
|
+
classification, plugin fallback, and formatting; `github-readiness.ts` performs
|
|
547
|
+
read-only settings/policy inspection, keeping incomplete evidence unknown. Host
|
|
548
|
+
init validation invokes the configured registry forge outside guest probes.
|
|
549
|
+
Dispatch inspects after acquiring its repository lease and writes validated
|
|
550
|
+
`dispatcher.forge-readiness-failed` facts once per run/check for known hard
|
|
551
|
+
failures. `kernel/dispatch-status.ts` retains their typed collection across ticks
|
|
552
|
+
and reloads; the independent frontend and operator query project the same warnings.
|
|
553
|
+
`ab watch` follows these repository attention events for external orchestrators.
|
|
554
|
+
See [setup](setup.md#forge-readiness) for requirements and access guidance.
|
|
555
|
+
|
|
540
556
|
**Forge credentials.** `packages/core/src/ports/forge/github-transport.ts` owns the
|
|
541
557
|
REST transport seam and credential resolution for the builtin GitHub forge:
|
|
542
558
|
`GITHUB_TOKEN`, then `GH_TOKEN`, then the gh CLI's stored login read through
|
|
@@ -550,6 +566,35 @@ dispatcher — requires an exported token before any side effect and never consu
|
|
|
550
566
|
a checkout-less host has neither gh nor a keyring, and `vercel-sandbox` publication
|
|
551
567
|
injects that same token.
|
|
552
568
|
|
|
569
|
+
**Stable build identity.** The forge landing seam accepts optional build identity at operation time. Both
|
|
570
|
+
built-in adapters preserve their squash message and normalize a final
|
|
571
|
+
`Autobuild-Build: <slug>` trailer through `packages/core/src/kernel/build-identity.ts`. The GitHub
|
|
572
|
+
adapter reads the viewer's squash headline/body and head in one GraphQL query;
|
|
573
|
+
it never reconstructs server defaults from repository settings. The janitor
|
|
574
|
+
maintains native request message freshness after acknowledgement. A matching
|
|
575
|
+
request costs one GraphQL freshness query and no extra consent or pipeline read;
|
|
576
|
+
full gate inspection and refreshed durable consent/engine eligibility precede
|
|
577
|
+
any repair. Body comparison tolerates provider trimming of trailing whitespace
|
|
578
|
+
while preserving the complete headline, body content, and squash method.
|
|
579
|
+
|
|
580
|
+
Optional `Forge.readCommitMessage` and `Forge.containsBuild` capabilities expose
|
|
581
|
+
actual landed messages and exact trailer presence in reachable branch history.
|
|
582
|
+
The janitor records optional `pr.merged.buildTrailerPresent` for normal and abort
|
|
583
|
+
cleanup observations. Unsupported or failed inspection leaves evidence unknown;
|
|
584
|
+
a read failure also records an observation without preventing completion. Old
|
|
585
|
+
logs need no migration and keep the same status and presentation.
|
|
586
|
+
|
|
587
|
+
GitHub merge queues ignore squash-message overrides. The message query also
|
|
588
|
+
reads `repository.mergeQueue(branch:)`, covering classic protection and rulesets.
|
|
589
|
+
Its branch hint is checked against the PR's actual base, with a bounded re-query
|
|
590
|
+
after a retarget rather than assuming the repository default is the base.
|
|
591
|
+
Kernel auto-merge therefore
|
|
592
|
+
returns an actionable `unproven-gate-state` deferral for queue-protected bases;
|
|
593
|
+
it never bypasses the queue. Human queue landings still settle normally with
|
|
594
|
+
inspected trailer evidence when available. Expected-head guards and recurring
|
|
595
|
+
polls bound native message freshness, but cannot prevent a push and automatic
|
|
596
|
+
landing from both completing between polls.
|
|
597
|
+
|
|
553
598
|
**Agent runtimes.** `packages/core/src/ports/runner/`: `runtime.ts` (capability-carrying
|
|
554
599
|
registry plus boundary validation), `routing.ts` (eager role resolver),
|
|
555
600
|
`production.ts` (shipped Claude/Codex/Pi registrations), `codex.ts` (direct
|
|
@@ -697,13 +742,37 @@ queue. The supervised kernel child owns every slow
|
|
|
697
742
|
adapter operation, so slug naming, provisioning, runners, and Harvest cannot
|
|
698
743
|
block input.
|
|
699
744
|
|
|
745
|
+
`packages/core/src/cli/dashboard/refresh.ts` owns the shared presentation read
|
|
746
|
+
scheduler for both terminal paths: focused by default, paused on focus-out,
|
|
747
|
+
immediate on focus-in or keys, 500 ms with retained builds or during a 30-second
|
|
748
|
+
interaction hold, and 5 seconds when idle. Presentation store facades check
|
|
749
|
+
admission at every asynchronous read stage; the kernel uses its original store
|
|
750
|
+
and independent tick timers. Cached clock paints perform no reads. The mode
|
|
751
|
+
ledger owns focus reporting through teardown and catchable faults; job-control
|
|
752
|
+
suspension restores modes and input before stopping and reactivates with assumed
|
|
753
|
+
focus on resume. Plain, non-TTY, and once runs never enable focus reporting.
|
|
754
|
+
|
|
700
755
|
`packages/core/src/cli/build-progress.ts` projects the exact last-event, heartbeat, and lease
|
|
701
756
|
inputs shared by the diagnostic `ab builds` and `ab build status` surfaces. Its
|
|
702
757
|
one-hour `diverged` predicate is presentation-only: reducer status, engine
|
|
703
758
|
routing, and lease health remain independent. `packages/core/src/cli/dashboard/model.ts` is
|
|
704
759
|
the event-derived build-row projection; `poll.ts` reprojects rows for event or
|
|
705
|
-
effective-config changes and
|
|
706
|
-
|
|
760
|
+
effective-config changes and bounded enrichment refreshes while retaining the
|
|
761
|
+
cached log and reduction. `repository-poll.ts` serializes the complete presentation
|
|
762
|
+
snapshot in both terminal paths. It samples `getRepoChangePosition` before reads,
|
|
763
|
+
acknowledges it only after complete admitted reads, and reuses unchanged snapshots
|
|
764
|
+
for up to ten seconds. Scoped discovery uses `listBuildsForRepo`; unchanged focused
|
|
765
|
+
frames make one counter request. Session feeds remain independent.
|
|
766
|
+
|
|
767
|
+
The memory adapter maintains independent bigint counters; SQLite and PostgreSQL
|
|
768
|
+
increment `repo_change_positions` transactionally through triggers on build,
|
|
769
|
+
build-event, repository-event insertion and null-safe repository lease holder
|
|
770
|
+
changes. Reads return decimal text (unknown repos: `"0"`) without journal creation.
|
|
771
|
+
The hosted counter route returns only that position; scoped build discovery has
|
|
772
|
+
its own repository-authorized route before the journal-existence gate. PostgreSQL
|
|
773
|
+
counter DDL is additive, outside the guarded core schema/checksum, and must be
|
|
774
|
+
explicitly migrated before the service rollout. Existing writers use the same
|
|
775
|
+
triggers; rerunning migration preserves positions without replaying old events.
|
|
707
776
|
`detail.ts` projects chronological session history from the same retained log,
|
|
708
777
|
including a distinct transcriptless `reclaimed` ending, and `transcript.ts`
|
|
709
778
|
heuristically presents ordinary opaque transcript artifacts with a raw
|
|
@@ -988,13 +1057,13 @@ revisions rather than ignoring them.
|
|
|
988
1057
|
|
|
989
1058
|
`ab ticket edit <id>` opens `$VISUAL`, falling back to `$EDITOR`, using TOML
|
|
990
1059
|
frontmatter and a Markdown body. Only title, body and labels are editable;
|
|
991
|
-
id, blockers, creation key and reference comments are read-only. It saves only
|
|
1060
|
+
kind, target, id, blockers, creation key and reference comments are read-only. It saves only
|
|
992
1061
|
changed fields with the opening revision. Unchanged or formatting-only edits
|
|
993
1062
|
write nothing. On conflict, invalid input or editor failure, the error names an
|
|
994
1063
|
absolute file path containing the edited text. Read the current ticket and
|
|
995
1064
|
reapply the intended changes before retrying; conflicts are never merged.
|
|
996
1065
|
|
|
997
|
-
File and Linear revisions fingerprint title, body, canonical label/blocker sets
|
|
1066
|
+
File and Linear revisions fingerprint kind, target, title, body, canonical label/blocker sets
|
|
998
1067
|
and state; reverting identical content restores its fingerprint. File checks
|
|
999
1068
|
re-read immediately before writing, with the existing no-lock race window.
|
|
1000
1069
|
Direct file edits and state-directory moves change revisions. File comments
|
|
@@ -1020,3 +1089,155 @@ Hosted ticket detail reads expose complete, oldest-first structured comments in
|
|
|
1020
1089
|
HTTP clients opt in with `x-autobuild-ticket-comments: 1` so historical strict
|
|
1021
1090
|
decoders retain compatible responses. File comments remain embedded in the body;
|
|
1022
1091
|
Linear comment reads are unchanged.
|
|
1092
|
+
|
|
1093
|
+
Ticket integration metadata lives in `ports/tickets/tree.ts`: source compatibility
|
|
1094
|
+
normalization, capability refusal, graph validation and the pure tree projection.
|
|
1095
|
+
File/fake/Linear adapters validate metadata at write boundaries; `operations.ts`
|
|
1096
|
+
and CLI/operator source opening wrap injected or plugin sources with the same
|
|
1097
|
+
compatibility facade. Metadata is excluded from hosted persistence/protocols.
|
|
1098
|
+
|
|
1099
|
+
|
|
1100
|
+
### Integration node dispatch
|
|
1101
|
+
|
|
1102
|
+
The product dispatcher owns the workspace-free node lifecycle:
|
|
1103
|
+
spec → node.opening → node.opened → collecting → complete → verify:* → consent → land.
|
|
1104
|
+
The ordinary work pipeline is unchanged. `build.created` freezes kind, target
|
|
1105
|
+
ticket/build identity and resolved parent in `baseBranch`. Integration facts
|
|
1106
|
+
are projected by the shared reducer and digests, including collecting/empty
|
|
1107
|
+
state. Admission resolves same-source targets through repository read facts;
|
|
1108
|
+
integration identities remain active for deduplication but consume no work slot.
|
|
1109
|
+
|
|
1110
|
+
Optional Forge node branch creation and comparison capabilities let GitHub
|
|
1111
|
+
operate without a checkout and local-git operate directly on its shared refs.
|
|
1112
|
+
Opening intent retains the sampled SHA across retries; adoption requires that
|
|
1113
|
+
commit in the existing branch's history. Comparison uses reachability, so an
|
|
1114
|
+
advanced parent never makes an empty node nonempty. The janitor opens PRs lazily
|
|
1115
|
+
and reuses terminal cleanup without leaf reconcile or auto-merge.
|
|
1116
|
+
|
|
1117
|
+
### Leaf and reconcile restacking
|
|
1118
|
+
|
|
1119
|
+
The kernel prepares a detached replay of one net build change on the base frozen
|
|
1120
|
+
by `reconcile.started`. The contribution baseline is the initial branch-cut base
|
|
1121
|
+
or latest successfully published restack/reconcile base. The resolver continues that one replay;
|
|
1122
|
+
completion requires one parent at the frozen base and the build identity trailer.
|
|
1123
|
+
Historical merge completions retain their original shape and semantics.
|
|
1124
|
+
|
|
1125
|
+
The optional grouped Forge rewrite capability owns authoritative head snapshots,
|
|
1126
|
+
immutable `refs/autobuild/archive/<slug>/<sha>` publication and expected-head CAS.
|
|
1127
|
+
GitHub uses explicit Git transport leases; local-git uses shared-database
|
|
1128
|
+
`update-ref` CAS without network calls. Trusted remote publication archives before
|
|
1129
|
+
replacement after guest teardown; it never uses ordinary append-only publication
|
|
1130
|
+
for restacks. Prepared, replayed, intended and rewritten facts support recovery.
|
|
1131
|
+
A contended rewrite preserves the observed work and retries on the same base.
|
|
1132
|
+
|
|
1133
|
+
`kernel/leaf-restack-state.ts` projects target observations, frozen transactions
|
|
1134
|
+
and cycle gates into the log index and persisted build facts. The engine selects
|
|
1135
|
+
automatic kernel work before any verify action and after finalize post-steps when
|
|
1136
|
+
the target moves. `reconcile-restack.ts` shares collapse, detached replay,
|
|
1137
|
+
archive-before-replacement and expected-head publication mechanics. Automatic
|
|
1138
|
+
transactions emit `restack.*`; clean completion never starts a reconcile cycle.
|
|
1139
|
+
Pre-PR conflicts adopt the prepared replay through ordinary reconcile. Initial
|
|
1140
|
+
verification remains mandatory; waiting conflicts use post-reconcile policy.
|
|
1141
|
+
|
|
1142
|
+
The dispatcher observes targets without changing workspaces; execution ownership
|
|
1143
|
+
and session settlement fence mutation. Transaction targets stay frozen while
|
|
1144
|
+
later moves coalesce. `publication.requested` carries automatic transaction
|
|
1145
|
+
identity through trusted remote teardown and publication. The runner settles
|
|
1146
|
+
local resolver intent only after its session ends. Verification facts
|
|
1147
|
+
cite the cycle's base/head, and clean waiting rewrites preserve those results.
|
|
1148
|
+
Object packs retain newly introduced replay trees/blobs as well as commit bytes.
|
|
1149
|
+
|
|
1150
|
+
GitHub archive push/fresh-fetch and rewrite contracts are manual opt-in cases in
|
|
1151
|
+
`ports/forge/github.live.test.ts`, using `AB_RUN_LIVE_PORT_CONTRACTS=1` and an
|
|
1152
|
+
explicit disposable `AB_GITHUB_CONTRACT_REPO`. Offline transport tests are not
|
|
1153
|
+
live provider evidence.
|
|
1154
|
+
|
|
1155
|
+
### Descendant node restacking
|
|
1156
|
+
|
|
1157
|
+
`kernel/node-restack.ts` inventories the contribution above the durable previous
|
|
1158
|
+
base, proves foreign merge safety against the sampled parent's full identity set,
|
|
1159
|
+
and replays individual changes. `kernel/node-restack-state.ts` reduces writer
|
|
1160
|
+
reservations, ordered receipts, conflicts, publication intent, confirmed effects,
|
|
1161
|
+
and inventory. `kernel/node-restack-transaction.ts` retains replay objects and
|
|
1162
|
+
archives before expected-head publication. The dispatcher polls all open nodes,
|
|
1163
|
+
including empty nodes, and advances clean cascades without agent calls. Only the
|
|
1164
|
+
active conflicted item attaches a reconcile runner, using source-build artifacts
|
|
1165
|
+
materialized by the dispatcher into the integration owner's store scope.
|
|
1166
|
+
|
|
1167
|
+
`kernel/node-parent.ts` coordinates lifecycle-aware target mutations for CLI
|
|
1168
|
+
and operator requests. It canonicalizes source aliases, checks the latest build
|
|
1169
|
+
generation and proposed/effective/pending ancestry, and reserves a durable
|
|
1170
|
+
`node.parent-requested` before provider mutation. Claimed work targets stay frozen;
|
|
1171
|
+
a changed target requires abort and re-dispatch before any mixed patch is written.
|
|
1172
|
+
The dispatcher reads node tickets independently of readiness and activates a
|
|
1173
|
+
confirmed, revalidated request with `node.parent-accepted`. Provider edits use
|
|
1174
|
+
the same validation; refusals are deduplicated by revision, target and reason.
|
|
1175
|
+
Uncertain writes recover by source readback rather than replaying a caller patch.
|
|
1176
|
+
Tracker observation errors are contained within that observation, preserving
|
|
1177
|
+
ordinary cascade and PR handling against durable ancestry. Already accepted moves
|
|
1178
|
+
complete their PR effects without another tracker read. Rejection comparisons use
|
|
1179
|
+
revision, target and reason fields so JSONB key ordering cannot defeat deduplication;
|
|
1180
|
+
`node.parent-rejection-cleared` removes a current refusal after correction while
|
|
1181
|
+
preserving its history.
|
|
1182
|
+
|
|
1183
|
+
Accepted parent facts update node target/base projections while creation facts
|
|
1184
|
+
remain provenance. Pending requests and moves fence verification, child landing
|
|
1185
|
+
and source landing, and count against both parents' completeness. Existing writer
|
|
1186
|
+
reservations settle before activation. The existing replay transaction freezes the
|
|
1187
|
+
new destination and retains the old contribution boundary until completion, even
|
|
1188
|
+
for distinct parents at the same SHA. Afterwards the dispatcher retargets the same
|
|
1189
|
+
PR through the optional `Forge.retargetPr` capability, inspects its acknowledged
|
|
1190
|
+
base/head, records a receipt and completes the parent operation. GitHub uses the
|
|
1191
|
+
[documented PR update endpoint](https://docs.github.com/en/rest/pulls/pulls#update-a-pull-request)
|
|
1192
|
+
with a branch-name `base`. Publication and PR acknowledgement retry separately;
|
|
1193
|
+
terminal human PR changes keep their ordinary handling. Children retain the moved
|
|
1194
|
+
node's identity and branch, so the usual target observations cascade the move.
|
|
1195
|
+
|
|
1196
|
+
In origin mode, node plumbing uses the forge's trusted `kernelExec` transport.
|
|
1197
|
+
The GitHub adapter supplies its token through subprocess-only Git configuration,
|
|
1198
|
+
scoped to the repository's HTTPS URL; credentials are absent from argv, saved
|
|
1199
|
+
remote URLs, repository configuration and agent environments. Parent snapshots,
|
|
1200
|
+
archives and expected-head writes use this same transport. The dispatcher checks
|
|
1201
|
+
parent and node heads through the forge API before acquiring a repository: an
|
|
1202
|
+
unchanged inventory needs no clone or Git commands. A required temporary clone
|
|
1203
|
+
completes before the node writer lease is acquired, so download time cannot
|
|
1204
|
+
expire writer authority. Build sandbox publication retains its separate trusted
|
|
1205
|
+
receive-pack path.
|
|
1206
|
+
|
|
1207
|
+
`kernel/node-landing.ts` shares the node writer lease and reservation with
|
|
1208
|
+
restacking. It cancels native auto-merge, refreshes actual PR refs, proves the
|
|
1209
|
+
exact destination ungated and fast-forwards the canonical child commit under
|
|
1210
|
+
CAS. The destination write proves landing; provider PR reconciliation is
|
|
1211
|
+
best-effort and never decides or retries that write. Root landing retains squash
|
|
1212
|
+
semantics. Store adapters expose node writer claim, renewal and holder-checked
|
|
1213
|
+
release separately from execution leases; Postgres schema version 15 adds their
|
|
1214
|
+
columns. Reservations live in the event stream and survive lease expiry.
|
|
1215
|
+
|
|
1216
|
+
The contribution boundary advances only on completed restacks. Reachable build
|
|
1217
|
+
identities include inherited parent changes; foreign counts include only the
|
|
1218
|
+
node's own contribution, preventing a parent rewrite from inflating descendants'
|
|
1219
|
+
foreign inventory. Status text and JSON expose both inventory and active items.
|
|
1220
|
+
|
|
1221
|
+
|
|
1222
|
+
Integration completion is sampled by `kernel/integration-completeness.ts` from
|
|
1223
|
+
exhaustive source listings, frozen claims and retained contribution identities.
|
|
1224
|
+
`integration.*` events retain observations, immutable cycle inputs, landing
|
|
1225
|
+
intents, provenance and tree audits. The build reducer projects these facts and
|
|
1226
|
+
`engine.ts` routes nodes directly through verification, without producer phases.
|
|
1227
|
+
Failed cycles park for repair children. The dispatcher temporarily provisions
|
|
1228
|
+
verification resources and rechecks head, parent, controls and completeness
|
|
1229
|
+
before publication. `integration-landing.ts` owns source-reserved root landing
|
|
1230
|
+
and immutable result audits; nested nodes use the destination writer transaction
|
|
1231
|
+
in `node-landing.ts`. GitHub uses guarded PR rebase; local-git uses an ancestry
|
|
1232
|
+
proof and exact-parent fast-forward. Shared status vocabulary exposes provenance
|
|
1233
|
+
and mismatch attention in both frontends. Human forge merges remain observable
|
|
1234
|
+
escape hatches independent of completeness and verification.
|
|
1235
|
+
|
|
1236
|
+
### Landing authorization
|
|
1237
|
+
|
|
1238
|
+
The pure evaluator in `kernel/landing-policy.ts` chooses the first matching
|
|
1239
|
+
`[[landing]]` rule. `kernel/landing-state.ts` reduces immutable candidate
|
|
1240
|
+
decisions and persistent hold/land commands. The dispatcher owns readiness,
|
|
1241
|
+
ticket label sampling and native-state convergence. `kernel/landing-publication.ts`
|
|
1242
|
+
confirms native cancellation at local and trusted remote head-publication seams.
|
|
1243
|
+
Node landings retain the existing writer serialization and gate proof.
|
|
Binary file
|
package/docs/configuration.md
CHANGED
|
@@ -214,6 +214,7 @@ These fields hot-reload:
|
|
|
214
214
|
| `ticketScanIntervalSeconds` | Next tick; evaluates elapsed time against the new interval. |
|
|
215
215
|
| `capacity` | Next dispatcher tick. |
|
|
216
216
|
| `[pr]` | Next build creation. |
|
|
217
|
+
| `[landing]` (ordered `[[landing]]` rules) | Dispatcher-owned policy; next new readiness decision. Existing decisions retain their sampled rule. |
|
|
217
218
|
| `[commands]` | Next setup, verify check, or finalize check selected for a build whose OWN branch carries it. Dispatcher readiness, resume, and recovery use the same pin. A base-branch reload does not retarget an in-flight build. |
|
|
218
219
|
| `[verify]` and `[finalize]` | Next engine step selection for a build whose OWN branch carries it. Dispatcher readiness, resume, and recovery use the same pin. An approved plan's stored verify selection remains authoritative, and a base-branch reload does not retarget an in-flight build. |
|
|
219
220
|
| `[workspace]` provider and config (including `provisioning`) | Next launch of a build whose OWN branch carries it. A base-branch reload never re-provisions an in-flight build. |
|
|
@@ -445,6 +446,32 @@ runtime's optional one-shot capability serves slug naming and lazy upgrade
|
|
|
445
446
|
conflict resolution; when absent, each caller retains its existing safe
|
|
446
447
|
fallback.
|
|
447
448
|
|
|
449
|
+
## `[[landing]]`
|
|
450
|
+
|
|
451
|
+
An ordered list of strict landing rules. Predicates within one rule are ANDed;
|
|
452
|
+
the first matching rule wins. Omitted predicates match everything. With no
|
|
453
|
+
matching rule, leaves default to `auto` and nodes to `consent`.
|
|
454
|
+
|
|
455
|
+
| Field | Meaning |
|
|
456
|
+
|---|---|
|
|
457
|
+
| `into` | Optional destination: `root`, any `node`, or an exact frozen destination node ticket id. |
|
|
458
|
+
| `from` | Optional source kind: `leaf` or `node`. |
|
|
459
|
+
| `label` | Optional exact, case-sensitive label on the source ticket. Blank labels are invalid. |
|
|
460
|
+
| `mode` | Required `auto` or `consent`. |
|
|
461
|
+
|
|
462
|
+
For example, put a rule with `into = "root"` and `mode = "consent"`
|
|
463
|
+
before a catch-all rule with `mode = "auto"` to request consent only at the
|
|
464
|
+
root. A catch-all placed first shadows every later rule. Specific-node rules
|
|
465
|
+
match the build's frozen destination, rather than the ticket's current parent.
|
|
466
|
+
|
|
467
|
+
A readiness decision retains the complete matched rule and index (or an explicit
|
|
468
|
+
default), source kind, destination and sampled labels. Later policy edits do not
|
|
469
|
+
rewrite this provenance. Landing policy belongs to the live dispatcher config;
|
|
470
|
+
it is excluded from pinned pipeline settings and integration verification inputs.
|
|
471
|
+
See [worked landing configurations and forge requirements](landing-policy.md),
|
|
472
|
+
[operating controls](#landing-policy), and
|
|
473
|
+
[migration from 0.x](migration-1.0.md).
|
|
474
|
+
|
|
448
475
|
## `[pr]`
|
|
449
476
|
|
|
450
477
|
Optional. Omitting the table leaves attachment hosting off; attached artifacts
|
|
@@ -1243,6 +1270,25 @@ invariants, not additional configuration fields.
|
|
|
1243
1270
|
|
|
1244
1271
|
## `[tickets]`
|
|
1245
1272
|
|
|
1273
|
+
### Ticket kind and target metadata
|
|
1274
|
+
|
|
1275
|
+
`kind` and `target` are fields on individual tickets, not `[tickets]` TOML keys.
|
|
1276
|
+
`kind` defaults to `work`; `node` creates a finite integration point. Omitted
|
|
1277
|
+
`target` means the configured `baseBranch` root. A target must be a same-source
|
|
1278
|
+
node ticket id. `ab ticket update <id> --target <node-id>` changes it;
|
|
1279
|
+
`--no-target` clears it and `--kind work` resets kind. Omitted update fields
|
|
1280
|
+
preserve values. Claimed work targets cannot change: abort and re-dispatch.
|
|
1281
|
+
Open nodes can reparent under the guarded protocol, revoking land consent.
|
|
1282
|
+
|
|
1283
|
+
File tickets persist the fields in frontmatter; hosted tickets store them with
|
|
1284
|
+
project-scoped transactional validation. Linear maps kind to the exact `node`
|
|
1285
|
+
label and target to a parent carrying that label. Ordinary grouping parents do
|
|
1286
|
+
not impose targets; explicit clear removes the parent relation. Node demotion
|
|
1287
|
+
with targeting children and cycles are refused regardless of child state.
|
|
1288
|
+
See [integration trees](integration-tree.md) for admission, lifecycle and commands.
|
|
1289
|
+
|
|
1290
|
+
### Source configuration
|
|
1291
|
+
|
|
1246
1292
|
To move an existing project between sources, follow the
|
|
1247
1293
|
[ticket migration procedure](ticket-migration.md).
|
|
1248
1294
|
|
|
@@ -1647,8 +1693,10 @@ configuration. The setup prompt instead asks the agent to review and improve
|
|
|
1647
1693
|
the existing config.
|
|
1648
1694
|
|
|
1649
1695
|
Re-running init still maintains the `.autobuild/` ignore rule and skill
|
|
1650
|
-
installation. `ab upgrade`
|
|
1651
|
-
|
|
1696
|
+
installation. `ab upgrade` migrates an absent landing policy from the target
|
|
1697
|
+
repository journal; explicit landing arrays are preserved. See
|
|
1698
|
+
[migration from 0.x](migration-1.0.md). By default it first updates a recognized
|
|
1699
|
+
Bun installation — from the npm registry
|
|
1652
1700
|
for a registry install, or from GitHub Releases for a `github:` install — and
|
|
1653
1701
|
then merges vendored skills from that distribution. For a local install, Bun may update the
|
|
1654
1702
|
*owning* project's Autobuild dependency in `package.json` and `bun.lock`; this
|
|
@@ -1705,7 +1753,7 @@ either retirement.
|
|
|
1705
1753
|
|
|
1706
1754
|
## Durable settings outside TOML
|
|
1707
1755
|
|
|
1708
|
-
|
|
1756
|
+
Three repository-wide operator choices intentionally live as facts in the
|
|
1709
1757
|
BuildStore repository journal, not in `autobuild.toml`. They are latest-write
|
|
1710
1758
|
wins, survive process restarts, and are sampled by every dispatcher on its
|
|
1711
1759
|
poll. Editing TOML cannot change them.
|
|
@@ -1714,13 +1762,13 @@ poll. Editing TOML cannot change them.
|
|
|
1714
1762
|
|---|---:|---|---|
|
|
1715
1763
|
| Ticket intake | on | `ab dispatch --intake` / `--no-intake`; `i` on the dashboard's global row, and `p` (pause all) / `r` (resume all) on that row or their sessionless equivalents `ab pause --all` / `ab resume --all`, which turn intake off and on as part of quiescing the repository | When off, skip only new ticket list/claim/dispatch work. Janitor work, lease recovery, in-flight builds, and harvesting continue. Turning intake off does not hold builds the repository has already accepted — that is the repository pause below. |
|
|
1716
1764
|
| Repository pause | off | `p` (pause all) / `r` (resume all) on the dashboard's global row, or `ab pause --all` / `ab resume --all` | While on, the dashboard controls line shows `repository PAUSED`, and each held queued row shows `(held)` while retaining its literal `QUEUED` status. No dispatcher tick attaches a runner to such a build — recovery, startup resume, and the lease sweep all skip them. Running builds are parked by the per-build pauses the same command writes; the janitor still settles aborts and discards. |
|
|
1717
|
-
| Repository auto-merge default | off | `ab dispatch --auto-merge` / `--no-auto-merge`; `m` on the global row | Seeds durable auto-merge intent on builds claimed while the setting is enabled, and — on each change — also applies as a bulk action to every current non-terminal build: turning it on requests consent for each build (turning it off withdraws it), attributed to the operator who toggled it exactly as if they had pressed `m` on every row. A per-build toggle overrides its build's state until the global row is toggled again. |
|
|
1718
1765
|
| Harvest gate | on | `h` on the dashboard's global row | Pauses or resumes repository observation harvesting. The header shows the kernel-acknowledged gate, not merely a pending keypress. |
|
|
1719
1766
|
|
|
1720
1767
|
The opposite flag forms for each dispatch setting are mutually exclusive.
|
|
1721
1768
|
Omitting both writes nothing and reuses the durable value. Per-build
|
|
1722
|
-
pause/resume and
|
|
1723
|
-
repository
|
|
1769
|
+
pause/resume and landing controls are separate facts and do not alter these
|
|
1770
|
+
repository settings; landing authorization follows `[[landing]]`. Pause all and
|
|
1771
|
+
resume all write two facts each — the
|
|
1724
1772
|
repository pause first, then intake — so a partial failure still leaves the
|
|
1725
1773
|
repository at least as quiesced as asked; `ab pause --all` reports on stderr
|
|
1726
1774
|
which of them landed when a walk stops partway. The current release has no TOML
|
|
@@ -1758,8 +1806,10 @@ set or copy them into `.env`; the runner stamps them for each session.
|
|
|
1758
1806
|
|
|
1759
1807
|
Forge and agent credentials remain adapter-owned. The `local-git` forge uses no
|
|
1760
1808
|
credentials or network access: it keeps durable PR records under private Git
|
|
1761
|
-
refs, leaves each build at `refs/heads/ab/<slug>`, and
|
|
1762
|
-
|
|
1809
|
+
refs, leaves each work build at `refs/heads/ab/<slug>`, and lands root leaves by
|
|
1810
|
+
squash under the recorded landing authorization. Node landings use guarded
|
|
1811
|
+
fast-forwards; see [landing methods](landing-policy.md#landing-methods).
|
|
1812
|
+
The squash author and committer come from the
|
|
1763
1813
|
repository's ordinary Git identity, as resolved for a plain `git commit`; the
|
|
1764
1814
|
landing is always unsigned even when `commit.gpgsign` is enabled. If Git cannot
|
|
1765
1815
|
resolve that identity, the PR remains open and `ab build status <slug>` names
|
|
@@ -1891,21 +1941,24 @@ configuration still rejects unknown override keys.
|
|
|
1891
1941
|
|
|
1892
1942
|
## Hosted service client compatibility
|
|
1893
1943
|
|
|
1894
|
-
A service accepts stable clients from its own `major.minor`
|
|
1895
|
-
the two preceding minor lines in the same major. A major starts a new family:
|
|
1944
|
+
A service accepts stable and prerelease clients from its own `major.minor`
|
|
1945
|
+
release line and the two preceding minor lines in the same major. A major starts a new family:
|
|
1896
1946
|
X.0 accepts only X.0, X.1 accepts X.0/X.1, and X.2 onward accepts three lines.
|
|
1897
1947
|
Patch versions are interchangeable in both directions and must never change
|
|
1898
1948
|
the protocol. Upgrade the service first, then projects independently within
|
|
1899
1949
|
its window. Supported release lines retain their wire handlers and known
|
|
1900
1950
|
protocol identities; an unknown protocol is refused independently of version.
|
|
1901
|
-
|
|
1951
|
+
Stable and prerelease service and client identities share their numeric major/minor
|
|
1952
|
+
line. Malformed or missing identities, build metadata (`+…`), prefixes and
|
|
1953
|
+
whitespace are refused with HTTP 409.
|
|
1902
1954
|
A newer client is told to upgrade the service; a client below the window is
|
|
1903
1955
|
told to upgrade the project's Autobuild. Diagnostics name the service version
|
|
1904
1956
|
and supported range.
|
|
1905
1957
|
|
|
1906
1958
|
Unauthenticated `GET /health` publishes `ok`, `autobuildVersion`,
|
|
1907
1959
|
`protocolVersion`, and `supportedClientRange: { minVersion, maxVersionExclusive }`.
|
|
1908
|
-
The range is inclusive at the minimum
|
|
1960
|
+
Range endpoints remain stable versions. The range is inclusive at the minimum
|
|
1961
|
+
and exclusive at the maximum; a 0.11.x
|
|
1909
1962
|
service publishes `>=0.9.0 <0.12.0`. Health needs no credentials, version
|
|
1910
1963
|
headers, or available backend.
|
|
1911
1964
|
|
|
@@ -1916,3 +1969,50 @@ and is never supplied; factory environments also exclude `AB_TOKEN`. Launch
|
|
|
1916
1969
|
credentials travel through the separate transient execution-auth argument, never
|
|
1917
1970
|
through serialized execution identity. Existing plugins that forwarded
|
|
1918
1971
|
`storeToken` must migrate to this callback and fail closed if it is unavailable.
|
|
1972
|
+
|
|
1973
|
+
## Landing policy
|
|
1974
|
+
|
|
1975
|
+
The [`[[landing]]` table](#landing) defines ordered authorization rules and
|
|
1976
|
+
readiness provenance. See [landing policy](landing-policy.md) for examples,
|
|
1977
|
+
merge methods and forge capability requirements.
|
|
1978
|
+
|
|
1979
|
+
`ab hold <slug>` durably suppresses landing and revokes previous consent, even
|
|
1980
|
+
before readiness. `ab land <slug>` requires readiness, clears hold, and consents
|
|
1981
|
+
to this build/node landing into its effective destination. Consent survives head
|
|
1982
|
+
replacement, restacking, verification and re-finalization until another hold or
|
|
1983
|
+
completion. Accepted node reparenting revokes consent; holds survive.
|
|
1984
|
+
It is consent to the landing, not approval of an immutable diff.
|
|
1985
|
+
Commands and acknowledgements are sequence-correlated; hold acknowledgement
|
|
1986
|
+
requires confirmed native cancellation, while land acknowledgement accepts
|
|
1987
|
+
consent without claiming that merge gates passed. The same actions are available
|
|
1988
|
+
through the MCP/operator build-control tools. The terminal uses `l` for land and
|
|
1989
|
+
`o` for hold on the selected landing. The web has no consent controls.
|
|
1990
|
+
|
|
1991
|
+
The repository auto-merge default and its fan-out are retired. Historical events
|
|
1992
|
+
still replay; explicit old per-build commands map to consent/hold until a new
|
|
1993
|
+
landing command supersedes them, while old default seeds confer no consent.
|
|
1994
|
+
`ab upgrade` samples the target repository's configured journal and writes leaf
|
|
1995
|
+
auto for old ON, leaf consent for old OFF (including no fact), and node consent
|
|
1996
|
+
in either case. Explicit landing arrays remain byte-for-byte unchanged. Missing
|
|
1997
|
+
configuration or unavailable journals fail with recovery guidance. Fresh init
|
|
1998
|
+
uses the no-rules fallback.
|
|
1999
|
+
|
|
2000
|
+
Native auto-merge is reconciled on every janitor poll against durable desired
|
|
2001
|
+
landing state. It is disabled while held, unauthorized, unready, or replacement
|
|
2002
|
+
publication is pending or just completed; enabling binds to the current head
|
|
2003
|
+
through the forge's expected-head guard. Every replacement publication confirms
|
|
2004
|
+
cancellation first, and its first following poll re-reads and reconciles native
|
|
2005
|
+
state before other build actions. Native receipts bind to exact candidates;
|
|
2006
|
+
consent does not. A stale enable completing after cancellation is repaired by
|
|
2007
|
+
poll reconciliation. This is an explicitly bounded failure model: native merge
|
|
2008
|
+
is used only behind a merge-blocking gate, and checks on a replacement head must
|
|
2009
|
+
take far longer than one poll interval, allowing cancellation before they pass.
|
|
2010
|
+
There is no durable native-effect reservation protocol. An undesired forge
|
|
2011
|
+
landing is classified from the kernel's last durable native application state, without changing provider contracts. A confirmed disabled
|
|
2012
|
+
state with no enable in flight or indeterminate means a deliberate human forge
|
|
2013
|
+
landing, which supplies consent. Record whether it overrode a hold: an unheld
|
|
2014
|
+
human landing needs no operator attention; overriding a hold is informational.
|
|
2015
|
+
If native auto-merge was armed, or an enable was in flight or indeterminate,
|
|
2016
|
+
record a possible stale-enable landing as contrary to policy and raise operator
|
|
2017
|
+
attention. Autobuild never rewrites the target to undo either outcome. Merge
|
|
2018
|
+
gates and the serialized node-writer publication rules remain authoritative.
|
package/docs/hosted-service.md
CHANGED
|
@@ -238,3 +238,21 @@ To retain earlier names configure `triageState = "Backlog"`,
|
|
|
238
238
|
`claimedState = "Doing"`, `doneState = "Done"`, and the desired `readyState`.
|
|
239
239
|
Existing ticket rows are never renamed. Older combined-service clients continue
|
|
240
240
|
using the uploaded dispatcher configuration until independent policy is published.
|
|
241
|
+
|
|
242
|
+
## Integration tree metadata
|
|
243
|
+
|
|
244
|
+
Hosted tickets store `kind` (`work` or `node`, default `work`) and optional
|
|
245
|
+
`target`, the canonical readable id of a node in the same project. Create accepts
|
|
246
|
+
both fields; update and guarded update preserve omitted fields and accept
|
|
247
|
+
`target: null` to clear an edge. Targets must exist and be nodes. Self-targets,
|
|
248
|
+
ancestor cycles, and demoting a node with targeting tickets (including completed
|
|
249
|
+
work) are rejected before any part of a mixed patch is written. Graph mutations
|
|
250
|
+
serialize per project in the same transaction as validation and revision checks.
|
|
251
|
+
Effective metadata changes increment the revision; equivalent aliases are no-ops.
|
|
252
|
+
|
|
253
|
+
Ticket responses include these fields only with `x-autobuild-ticket-tree: 1`.
|
|
254
|
+
This capability is independent of revision and comment capabilities and of the
|
|
255
|
+
client version. Without it, both fields are projected away, preserving historical
|
|
256
|
+
strict decoders. Current hosted clients send all three capability headers and
|
|
257
|
+
default absent kind to `work`. Unfiltered listing includes all ticket states and
|
|
258
|
+
empty nodes for `ab ticket tree`; dispatch and landing behavior are unchanged.
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# Integration trees
|
|
2
|
+
|
|
3
|
+
Autobuild organizes work as a tree rooted at the configured `baseBranch`.
|
|
4
|
+
Work tickets are leaves; node tickets are finite integration points that collect
|
|
5
|
+
children before landing into their parent. Nodes can nest. An omitted target
|
|
6
|
+
means the root, so repositories can continue sending every leaf directly there.
|
|
7
|
+
Blockers form a separate graph. In repositories with nodes, a blocker with a
|
|
8
|
+
build resolves only when its change identity is present in the dependent's
|
|
9
|
+
sampled destination, regardless of source completion. Without nodes, or for a
|
|
10
|
+
blocker without a build, native done-state resolution remains in effect.
|
|
11
|
+
See [restacking](restacking.md) for change identity and replay.
|
|
12
|
+
|
|
13
|
+
Presence is checked only at claim, never to interrupt existing work. The newest
|
|
14
|
+
build generation supplies evidence; ambiguous or unavailable evidence leaves the
|
|
15
|
+
dependent queued. Confirmed landing SHA reachability can prove presence without
|
|
16
|
+
a trailer, and a landed node transports its whole owned contribution. Empty
|
|
17
|
+
completed nodes contribute nothing. Sibling work waits for landing into the common
|
|
18
|
+
ancestor and cascade; same-node landings satisfy presence directly.
|
|
19
|
+
|
|
20
|
+
## Tickets and admission
|
|
21
|
+
|
|
22
|
+
Tickets default to `kind = "work"` with no `target`. A target is a node ticket
|
|
23
|
+
id in the same source. Targets must exist and be nodes; self-targets and ancestor
|
|
24
|
+
cycles are refused. A node with targeting tickets cannot be demoted, even when
|
|
25
|
+
those children are completed. Clear or reparent its children first.
|
|
26
|
+
|
|
27
|
+
File tickets persist kind and target in frontmatter. Hosted tickets validate
|
|
28
|
+
changes transactionally within the project. Linear uses the exact `node` label
|
|
29
|
+
for kind and the parent relation for target only when that parent has the node
|
|
30
|
+
label. Ordinary grouping parents remain grouping and survive unrelated edits;
|
|
31
|
+
explicit target clear clears the parent relation. Label replacement can demote a
|
|
32
|
+
node and receives the same guards; explicit kind and labels must agree. Linear
|
|
33
|
+
label and parent connections are fully paginated and guarded writes are refused.
|
|
34
|
+
Kind and target participate in content revisions; file writes retain their
|
|
35
|
+
best-effort unlocked semantics. `ab ticket edit` displays these fields read-only.
|
|
36
|
+
|
|
37
|
+
A ready node opens `ab-node/<slug>` at its parent's sampled head. Opening intent
|
|
38
|
+
and acknowledgement are durable. Its branch admits children immediately, with
|
|
39
|
+
no placeholder commit or PR. Idle nodes need no provisioned workspace, runner,
|
|
40
|
+
execution lease or dispatch capacity. A PR opens or is adopted when the node
|
|
41
|
+
has commits its current parent lacks; parent-only advancement remains empty.
|
|
42
|
+
|
|
43
|
+
Claims freeze the destination build generation and branch. Missing, unopened,
|
|
44
|
+
landed, closed or aborted targets leave work queued with diagnostics. The newest
|
|
45
|
+
generation wins; a closed generation never falls back to an older open one.
|
|
46
|
+
Source metadata and effective ancestry are different: `ab ticket tree` shows
|
|
47
|
+
source targets, while build status shows the effective destination.
|
|
48
|
+
|
|
49
|
+
## Collect, verify and land
|
|
50
|
+
|
|
51
|
+
Create a node and direct work into it (replace ids with those returned by your
|
|
52
|
+
source):
|
|
53
|
+
|
|
54
|
+
```sh
|
|
55
|
+
ab ticket create "Release candidate" --body candidate.md --kind node
|
|
56
|
+
ab ticket update WORK-2 --target NODE-1
|
|
57
|
+
ab ticket tree
|
|
58
|
+
ab ticket tree --json
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Use the ordinary native ticket lifecycle and ready gate to dispatch the node
|
|
62
|
+
and children. The tree includes completed work and empty nodes, sorted by id
|
|
63
|
+
among siblings; invalid external graphs and listing diagnostics remain explicit.
|
|
64
|
+
Each leaf runs the normal spec, plan/review, implement/review, verify and finalize
|
|
65
|
+
pipeline against its frozen destination.
|
|
66
|
+
|
|
67
|
+
A node collects until every ticket targeting it is natively done or cancelled,
|
|
68
|
+
all frozen child claims have settled, and at least one contribution has landed.
|
|
69
|
+
Triage, backlog and ready children keep it incomplete. Exhaustive enumeration
|
|
70
|
+
failures fail closed. Completeness is sampled again before verification and
|
|
71
|
+
publication; tracker edits cannot be transactional with a forge write.
|
|
72
|
+
|
|
73
|
+
The kernel runs all configured verify steps with normal path applicability on
|
|
74
|
+
the exact node head and parent. Either moving invalidates eligibility, even a
|
|
75
|
+
clean restack. Failed verification blocks the node: file a repair child targeting
|
|
76
|
+
it; the repaired landed head permits a new cycle. Historical reports keep their
|
|
77
|
+
actual head/base citations. Integration grammar is collect → verify → land →
|
|
78
|
+
close, with restacking and repair cycles along the way.
|
|
79
|
+
|
|
80
|
+
[Landing policy](landing-policy.md) defaults nodes to consent. Once complete and
|
|
81
|
+
verified, `ab land <slug>` authorizes landing; it refuses incomplete nodes and
|
|
82
|
+
names open children. `ab hold <slug>` works before readiness and withdraws
|
|
83
|
+
consent. Automatic authorization still requires every readiness and merge gate.
|
|
84
|
+
A landed node completes its ticket and closes admission; it is not a perpetual
|
|
85
|
+
staging branch. Releases remain separate maintainer operations.
|
|
86
|
+
|
|
87
|
+
Human forge merges are an explicit escape hatch, including while incomplete,
|
|
88
|
+
paused or unverified. The janitor records human provenance and whether the actual
|
|
89
|
+
merged head was verified, then completes the ticket. Closing without merge or
|
|
90
|
+
aborting closes admission and returns the ticket to triage; already claimed
|
|
91
|
+
children retain their frozen destination.
|
|
92
|
+
|
|
93
|
+
## Changing a parent
|
|
94
|
+
|
|
95
|
+
`ab ticket update NODE-1 --target NODE-2` reparents an open node;
|
|
96
|
+
`--no-target` moves it to the root. Omitted fields preserve existing values;
|
|
97
|
+
`--kind work` resets kind when valid. Only owned contributions replay onto the
|
|
98
|
+
new parent, then the same PR is retargeted. Empty and same-head moves need no
|
|
99
|
+
new commit or PR. Descendants follow through the normal cascade.
|
|
100
|
+
|
|
101
|
+
The request is durable before the provider write. Source readback accepts the
|
|
102
|
+
new effective ancestry; branch publication, PR retargeting and completion have
|
|
103
|
+
separate receipts. Pending moves fence verification and landing and keep both
|
|
104
|
+
parents incomplete. Reparenting revokes land consent; holds survive. Policy is
|
|
105
|
+
sampled again for the new parent, including when both parents have the same SHA.
|
|
106
|
+
|
|
107
|
+
Cycles, unopened/terminal parents, landing or closing nodes, unsupported PR
|
|
108
|
+
retargeting and busy writer operations refuse or defer the move with a reason.
|
|
109
|
+
Invalid direct provider edits leave effective ancestry unchanged and produce
|
|
110
|
+
durable diagnostics; restoring it clears the current refusal. Missing source
|
|
111
|
+
reads withhold acceptance, while an accepted operation can finish its reserved
|
|
112
|
+
Git/PR effects without the tracker. Ambiguous writes are reread on recovery.
|
|
113
|
+
Changing a claimed work ticket's target is refused before any combined patch is
|
|
114
|
+
written: abort and re-dispatch instead.
|
|
115
|
+
|
|
116
|
+
See [forge requirements](landing-policy.md#forge-requirements),
|
|
117
|
+
[restacking](restacking.md), and [migration from 0.x](migration-1.0.md).
|