@kungfu-tech/buildchain 4.0.1-alpha.2 → 4.0.1-alpha.3

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 (75) hide show
  1. package/architecture/decisions/0003-two-phase-delivery-warrant.md +152 -0
  2. package/architecture/internal-capabilities.json +94 -0
  3. package/architecture/maintainability-policy.json +75 -8
  4. package/architecture/v3-core-mechanism-inventory.json +2 -0
  5. package/architecture/v4-delivery-authority-parity.json +250 -0
  6. package/architecture/v4-delivery-warrant-shadow-fixtures.json +29 -6
  7. package/bin/buildchain.mjs +9 -1
  8. package/contracts/dev-delivery-authority-v2.schema.json +662 -0
  9. package/dist/site/agent-index.json +1 -0
  10. package/dist/site/artifact-schemas.json +2 -0
  11. package/dist/site/buildchain-contract.json +89 -6
  12. package/dist/site/buildchain-site.json +169 -18
  13. package/dist/site/capability-registry.json +2 -2
  14. package/dist/site/cli-registry.json +46 -2
  15. package/dist/site/kfd-claims.json +43 -9
  16. package/dist/site/kfd-upstream-aggregate.json +1 -1
  17. package/dist/site/manual-registry.json +3 -3
  18. package/dist/site/node-api-registry.json +1694 -165
  19. package/dist/site/page-registry.json +162 -11
  20. package/dist/site/public-surface-audit.json +367 -7
  21. package/dist/site/publication-registry.json +4 -4
  22. package/dist/site/release-provenance.json +2 -0
  23. package/dist/site/schemas/dev-delivery-authority-v2.schema.json +662 -0
  24. package/dist/site/site-manifest.json +7 -7
  25. package/dist/site/workflow-registry.json +22 -6
  26. package/docs/MAP.md +1 -0
  27. package/docs/cli-reference.md +211 -13
  28. package/docs/dev-delivery-qualification-landing-adr.md +251 -0
  29. package/docs/dev-delivery-warrant.md +326 -38
  30. package/docs/node-api-reference.md +113 -53
  31. package/package.json +5 -1
  32. package/packages/core/buildchain-contract.js +3 -2
  33. package/packages/core/dev-delivery-authority-candidate.js +270 -0
  34. package/packages/core/dev-delivery-authority-evidence.js +146 -0
  35. package/packages/core/dev-delivery-authority-landing.js +461 -0
  36. package/packages/core/dev-delivery-authority-observation.js +48 -0
  37. package/packages/core/dev-delivery-authority-qualification.js +591 -0
  38. package/packages/core/dev-delivery-authority-settlement.js +213 -0
  39. package/packages/core/dev-delivery-authority-state.js +583 -0
  40. package/packages/core/dev-delivery-candidate-identity.js +13 -0
  41. package/packages/core/dev-delivery-contract-surface.js +76 -0
  42. package/packages/core/dev-delivery-execution-failure.js +133 -0
  43. package/packages/core/dev-delivery-execution-transfer.js +572 -0
  44. package/packages/core/dev-delivery-landing-admission-core.js +119 -0
  45. package/packages/core/dev-delivery-landing-readback.js +598 -0
  46. package/packages/core/dev-delivery-landing-terminal-evidence.js +271 -0
  47. package/packages/core/dev-delivery-landing-testing-port.js +6 -0
  48. package/packages/core/dev-delivery-native-execution.js +110 -0
  49. package/packages/core/dev-delivery-native-proof.js +546 -0
  50. package/packages/core/dev-delivery-process-boundary.js +551 -0
  51. package/packages/core/dev-delivery-provider-attempt.js +127 -0
  52. package/packages/core/dev-delivery-provider-heartbeat.js +370 -0
  53. package/packages/core/dev-delivery-warrant-cancellation.js +1 -0
  54. package/packages/core/dev-delivery-warrant-qualification.js +145 -0
  55. package/packages/core/dev-delivery-warrant-settlement.js +237 -36
  56. package/packages/core/dev-delivery-warrant-state.js +565 -0
  57. package/packages/core/dev-delivery-warrant.js +320 -368
  58. package/scripts/buildchain-cli-help.mjs +11 -2
  59. package/scripts/dev-delivery-authority-command-adapters.mjs +206 -0
  60. package/scripts/dev-delivery-authority-provider.mjs +28 -0
  61. package/scripts/dev-delivery-authority.mjs +490 -0
  62. package/scripts/dev-delivery-native-run.mjs +177 -0
  63. package/scripts/dev-delivery-process-boundary.mjs +260 -0
  64. package/scripts/dev-delivery-proof.mjs +67 -2
  65. package/scripts/dev-delivery-provider-heartbeat.mjs +215 -0
  66. package/scripts/dev-delivery-two-phase-resume.mjs +345 -0
  67. package/scripts/dev-delivery-two-phase.mjs +573 -0
  68. package/scripts/dev-delivery-warrant-options.mjs +266 -0
  69. package/scripts/dev-delivery-warrant-store.mjs +227 -0
  70. package/scripts/dev-delivery-warrant.mjs +227 -193
  71. package/scripts/dev-pr-delivery-warrant.mjs +10 -0
  72. package/scripts/generate-site-bundle.mjs +26 -4
  73. package/scripts/npm-publish-transaction.mjs +2 -2
  74. package/scripts/site-capability-metadata.mjs +12 -0
  75. package/templates/native-dev-delivery.yml +141 -0
@@ -1,5 +1,5 @@
1
1
  ---
2
- status: draft
2
+ status: accepted
3
3
  period: ongoing
4
4
  theme: dev-delivery-warrant
5
5
  doc_type: technical-reference
@@ -7,8 +7,8 @@ source_level: local-files
7
7
  confidence: high
8
8
  sensitivity: public
9
9
  evidence_grade: A
10
- review_state: unreviewed
11
- last_reviewed: 2026-08-11
10
+ review_state: self-reviewed
11
+ last_reviewed: 2026-08-13
12
12
  ai_provenance:
13
13
  model_family: GPT-5
14
14
  product: Codex
@@ -38,10 +38,17 @@ and retained enqueue time.
38
38
 
39
39
  Selection is deterministic FIFO plus aging with bounded priority. Priority may
40
40
  reorder queued work, but it cannot preempt the active Warrant. Exactly one
41
- candidate receives a leased Warrant containing a fencing token, lease
42
- generation, expected-old state root, expiry, and the complete exact source
43
- binding. Heartbeat extends only that generation. Expiry recovery rejects the
44
- old token, retains queue age, and returns the candidate to selection.
41
+ candidate receives a `provisional` leased Warrant containing a fencing token,
42
+ lease generation, expected-old state root, expiry, and the complete exact
43
+ source binding. It reserves the next protected-dev landing before expensive
44
+ native shards start, but it is not GitHub Merge Queue admission authority.
45
+ Heartbeat extends only that generation. Native proof success atomically
46
+ upgrades the same token and generation to `qualified`; only then may enqueue
47
+ begin. Expiry fences further mutations by the old token, but it does not prove
48
+ that the old native process stopped. The active Warrant therefore remains in
49
+ place until bounded termination is proven by rooted terminal evidence. Only
50
+ that exact fenced settlement may clear the holder and permit successor
51
+ selection.
45
52
 
46
53
  A terminal event may cancel a candidate before selection without minting a
47
54
  Warrant. This transition is limited to an exact non-active queued candidate and
@@ -51,7 +58,12 @@ An active candidate still requires its current fencing token and lease
51
58
  generation. Exact duplicate cancellation evidence is a visible no-op; identity,
52
59
  state, event, or evidence drift fails closed.
53
60
 
54
- The reusable terminal controller uses one `settle` operation for active,
61
+ The reusable terminal controller classifies authoritative completion,
62
+ cancellation, supersession, native failure, and transient dequeue separately.
63
+ `dequeued` alone never clears an active Warrant: a fresh holder continues with
64
+ the same generation and token, while an expired holder waits for proof that its
65
+ fenced worker stopped. Queued work may still settle as dequeued because it never
66
+ started native execution. The controller uses one `settle` operation for active,
55
67
  queued, already-terminal, and never-admitted pull requests. An active Warrant
56
68
  still requires its exact fence and evidence. A matching queued cancellation is
57
69
  persisted normally. A duplicate terminal event or a pull request that never
@@ -73,23 +85,50 @@ That lane outranks not-yet-leased ordinary work, but never preempts or rewrites
73
85
  an active Warrant; unrelated, conflicted, mismatched, or fabricated claims fail
74
86
  closed before selection.
75
87
 
76
- ## Split proof authority
88
+ ## Three proof authorities
77
89
 
78
- Source Qualification Proof is independent of the moving dev base. It binds the
79
- semantic source, exact source head and patch/tree intent, plan, affected
80
- closure, dependencies, toolchain, covered paths, and shard evidence.
90
+ Source Qualification Proof is created from the cheap source-acceptance gate. It
91
+ binds the semantic source, exact source head and patch/tree intent, plan,
92
+ affected closure, dependencies, toolchain, covered paths, and exact acceptance
93
+ evidence. Ready state and approval are established before provisional
94
+ selection.
81
95
 
82
- Before reuse, the consumer classifies the dev delta:
96
+ Native Qualification Proof is separate. Its v4 form binds semantic source and patch,
97
+ plan, affected closure, dependency graph, toolchain, the exact execution
98
+ environment contract, covered paths, native shard evidence, the exact dev
99
+ base used by the native composition, and the v3 native heartbeat-run receipt.
100
+ That receipt exposes and roots the exact repository, protected base, source
101
+ head, qualified base, toolchain, and environment binding established before
102
+ process spawn. The proof carries the exact receipt bytes as well as repeating
103
+ the binding and receipt roots in its shard evidence. Public verification
104
+ recomputes those bytes and requires a successful outcome, positive heartbeat
105
+ count, exact command root, ordered start/completion/qualification timestamps,
106
+ and the complete execution binding; caller-computed roots without the receipt
107
+ bytes are not a v4 proof. Before reuse, the consumer roots the
108
+ complete attributed Dev delta, including both sides of every rename, then
109
+ classifies it:
83
110
 
84
- - unchanged roots plus an unrelated attributed delta reuse source
85
- qualification and run only a cheap Project Cut replay. GitHub's `behind`
111
+ - unchanged semantic roots plus an unrelated fully attributed base delta reuse
112
+ native qualification and run only a cheap Project Cut replay. GitHub's `behind`
86
113
  state is accepted only when a rooted replay proof binds the exact current
87
114
  protected base, unchanged PR head and source patch, replay tree, required
88
115
  context roots, and a qualified `project.cut.merge-queue-admission/v1`
89
116
  receipt;
90
- - an overlapping delta reruns the affected source shards;
91
- - an unknown graph or changed source, plan, closure, dependency, or toolchain
92
- root fails closed to full source qualification.
117
+ - an overlapping delta reruns affected native shards or the full native plan;
118
+ - an unknown or truncated graph, ambiguous rename, missing attribution, or
119
+ changed source, plan, closure, dependency, toolchain, or environment root
120
+ fails closed to full native qualification.
121
+
122
+ Historical Native Qualification Proof v1, v2, and v3 values remain readable,
123
+ but they cannot be reused because they do not carry the current v4 exact native
124
+ execution evidence. They fail closed to explicit native revalidation and
125
+ produce a v4 proof.
126
+
127
+ The reuse decision binds the exact old and current Dev heads, normalized changed
128
+ paths and rename pairs in `baseDeltaRoot`. This makes local and hosted replay of
129
+ the same inputs byte-deterministic. Generated outputs that participate in the
130
+ affected closure must be listed in `affected-paths-json`; a delta touching one
131
+ of those surfaces is overlap, not a documentation-only advance.
93
132
 
94
133
  Integration Delivery Proof is separate and cannot be cached across candidates.
95
134
  It binds the exact current dev base, replay tree, GitHub `merge_group` head and
@@ -108,11 +147,27 @@ buildchain dev warrant submit --repository owner/repository \
108
147
  --source-identity-root <root> --source-patch-root <root> \
109
148
  --source-proof-root <root> --plan-root <root> --closure-root <root> \
110
149
  --dependency-root <root> --toolchain-root <root> \
150
+ --environment-root <root> \
111
151
  --delivery-class native-proof-required
112
152
 
113
153
  buildchain dev warrant select --repository owner/repository \
114
154
  --branch dev/v4/v4.0 --execute
115
155
 
156
+ buildchain dev proof native --branch dev/v4/v4.0 \
157
+ --source-head <sha> --qualified-base <sha> \
158
+ --environment-root <root> \
159
+ --native-execution-receipt native-heartbeat-run.json \
160
+ --affected-paths-json '["packages/native"]' ...
161
+
162
+ buildchain dev proof classify-native --source-proof native-proof.json \
163
+ --current-base <sha> --graph-known true --attribution-complete true \
164
+ --changed-paths-json '[]' --renames-json '[]' ...
165
+
166
+ buildchain dev warrant qualify --repository owner/repository \
167
+ --branch dev/v4/v4.0 --fencing-token <root> --lease-generation 1 \
168
+ --native-proof native-proof.json \
169
+ --native-reuse-decision native-reuse-decision.json --execute
170
+
116
171
  buildchain dev warrant cancel-queued --repository owner/repository \
117
172
  --branch dev/v4/v4.0 --candidate-id <root> --pull-request 123 \
118
173
  --expected-source-head <queued-sha> --observed-source-head <event-sha> \
@@ -120,16 +175,51 @@ buildchain dev warrant cancel-queued --repository owner/repository \
120
175
  --evidence-root <terminal-event-root> --execute
121
176
  ```
122
177
 
123
- `heartbeat`, `recover`, `close`, `settle`, `cancel-queued`, and `observe` use the same durable authority.
178
+ `heartbeat`, `qualify`, `recover`, `close`, `settle`, `cancel-queued`, and `observe` use the same durable authority.
124
179
  Warrant-scoped mutations require the exact fencing token and lease generation.
125
180
  `close` also requires a rooted terminal evidence object.
126
181
 
127
- On the v4 preview line, `observe` alone has an explicit `--read-mode v4`
128
- candidate. It requires a retained exact semantic-diff qualification and source
129
- binding, invokes an effect-disabled Rust state projection, retains parity
130
- evidence, and returns the existing v3 observation shape. The default and
131
- rollback mode is `v3`; mutation commands ignore the read switch. See
132
- [`v4-delivery-warrant-read-candidate.md`](v4-delivery-warrant-read-candidate.md).
182
+ On the v4 line, `observe` also has an explicit `--read-mode v4` candidate. It requires retained exact semantic-diff qualification and source binding, invokes the effect-disabled Rust projection, retains parity evidence, and returns the existing observation shape. The default and rollback mode remains `v3`; mutation commands ignore the read switch. See [`v4-delivery-warrant-read-candidate.md`](v4-delivery-warrant-read-candidate.md).
183
+
184
+ Expensive native commands must run through `dev-delivery-native-run.mjs` (or an
185
+ equivalent exact consumer). Before spawn it validates the environment and
186
+ execution roots and traverses the complete Linux `/proc` ancestry. An unreadable
187
+ process environment or status is a failure, as is any variable name containing a
188
+ generic auth, credential, key, password, secret, or token segment. The child
189
+ still receives only the fixed process-basics allowlist. The command root,
190
+ exact execution binding and root, successful outcome, child start and completion
191
+ times, and heartbeat count are included in the native receipt. The controller
192
+ keeps retained-fence heartbeats across the direct child lifetime and requires a
193
+ final successful heartbeat after child exit; process-group termination on fence
194
+ loss remains fail-closed runtime behavior rather than a claimed receipt field.
195
+
196
+ The reusable workflow does not run that controller in a credentialed job. A
197
+ GitHub-hosted `native-execution` job has read-only checkout permission, no
198
+ provider write credential in the candidate step or its ancestry, and cannot
199
+ qualify, settle, enqueue, or renew provider state. It copies only rooted proof
200
+ and Warrant bytes into a dedicated staging directory and uploads that closed set.
201
+ The success artifact contains exactly its transfer manifest, Warrant, native
202
+ result, native proof, and reuse decision; the failed-native artifact contains
203
+ exactly its transfer manifest, Warrant, canonical rooted failure, and
204
+ provider-settlement binding. Recursive verification rejects missing or extra
205
+ entries, duplicate or case-colliding paths, traversal, symlinks, directories,
206
+ other non-regular entries, non-canonical failure or manifest JSON bytes, byte
207
+ drift, and mutation between the first and second recursive membership
208
+ snapshots. A
209
+ dependent GitHub-hosted finalizer downloads those bytes and uses live
210
+ Actions job readback to prove different positive job ids, different runner
211
+ identities, a matching run attempt, and strict native-completion-before-finalizer
212
+ ordering. It recomputes the canonical failure root and binds that exact root,
213
+ transfer root, native job, Warrant state and fence into the live provider
214
+ boundary. Failure settlement consumes those verified coordinates directly; it
215
+ does not synthesize a second failure. The boundary also roots a live open-PR
216
+ head and protected-ref readback. The trusted finalizer uses its provider credential only for
217
+ those GET readbacks until the byte transfer, runner boundary, and semantic native
218
+ proof have passed independent verification. It then rereads the live PR head,
219
+ protected base, and Warrant fence before qualifying or settling. A missing or
220
+ corrupt artifact, unreadable `/proc`, same job or runner, invalid timestamp,
221
+ self-hosted label, stale PR/base/fence, or readback mismatch fails closed. Native
222
+ exit zero is only evidence input.
133
223
 
134
224
  Proof commands create, verify, classify, and compose the two proof layers:
135
225
 
@@ -142,27 +232,182 @@ buildchain dev proof replay-proof \
142
232
  buildchain dev proof integration --warrant-result warrant.json ...
143
233
  ```
144
234
 
235
+ ## Opt-in bounded qualification and exclusive landing
236
+
237
+ Buildchain also defines an explicit production opt-in that turns successful
238
+ shadow evidence into a separate v2 authority state. It does not widen or
239
+ reinterpret the v1 Warrant queue. The accepted
240
+ [`Qualification Lease and Landing Warrant ADR`](dev-delivery-qualification-landing-adr.md)
241
+ and `contracts/dev-delivery-authority-v2.schema.json` are authoritative.
242
+
243
+ In `bounded-qualification-landing` mode, a configured number of exact
244
+ Qualification Leases may coexist. Each lease carries
245
+ `authority = qualification-only` and `mergeGroupAdmission = false`. Completing
246
+ qualification records evidence and releases that lease. Qualified candidates
247
+ then wait for the one `Landing Warrant`, which alone carries
248
+ `authority = merge-group-admission` and may be checked for `merge_group`
249
+ admission.
250
+
251
+ Concurrency is granted only across disjoint rooted `qualificationDomains`.
252
+ Overlap and unknown domains are held behind the active safety boundary with an
253
+ explicit content-rooted reason. `maxLandingOvertakes` prevents a slow older
254
+ candidate from being bypassed indefinitely, while `maxQualificationAttempts`
255
+ turns repeated heartbeat loss into a rooted terminal failure. Every release
256
+ returns a deterministic rooted wake instruction; an exact duplicate release or
257
+ recovery is a state-root-preserving no-op.
258
+
259
+ An expired qualification-only lease may release its bounded compute slot. An
260
+ expired Landing Warrant does not release exclusive provider authority by time
261
+ alone: recovery retains it and requires exact provider-stop or terminal
262
+ settlement evidence for the same token and generation before another landing
263
+ candidate can be selected. Expired cleanup invokes a separate independent
264
+ provider terminal verifier after candidate exit. Its rooted readback must match
265
+ the exact repository, protected base, authority state root, candidate, pull
266
+ request, source head, Landing token and generation, provider run and job, and a
267
+ fresh observation for that Warrant. Caller assertions, forged roots, wrong
268
+ bindings, nonterminal states, and stale observations cannot release the slot.
269
+ The verifier reads the immutable historical run-attempt endpoint. A later rerun
270
+ or synchronized PR head cannot rewrite the admitted attempt or prevent its
271
+ terminal settlement; current PR identity and protected base still must match.
272
+ The reader rejects an empty run conclusion, nonterminal run or job state,
273
+ unsupported job conclusion, or pull-request state outside `open|closed` before
274
+ it can seal product-owned cleanup evidence.
275
+
276
+ The public two-phase workflow keeps heartbeat authority in a fourth,
277
+ GitHub-hosted job on a runner domain distinct from admission, native execution,
278
+ evidence sealing, and finalization. Each successful heartbeat records the exact
279
+ expected-old and next authority state roots plus its receipt root. The
280
+ credentialless native job holds only its immutable admission binding; the
281
+ hosted coordinator alone renews durable state. After heartbeat loss it records
282
+ the exact current attempt but never invokes GitHub's run-scoped cancellation
283
+ API, so a successor rerun cannot be cancelled through a stale coordinate. All boundary jobs must prove the exact
284
+ `GitHub Actions` hosted runner group and reject `self-hosted`. The finalizer
285
+ rereads the provider job set and live authority state, rejects missing
286
+ or reordered receipt continuity, and requires the live state root to equal the
287
+ receipt's latest root before it can qualify, settle, or land.
288
+
289
+ A terminal native failure retains the complete provider chain through every
290
+ write-normalize-observe-remutate cycle: `transferRoot`,
291
+ `finalizerBoundaryRoot`, `nativeJobId`, `sealJobId`, the exact admitted
292
+ `providerAttempt`, and, when expiry cleanup was required, the independent
293
+ `providerTerminalReadbackRoot`.
294
+
295
+ Buildchain's tracked self-delivery caller invokes
296
+ `kungfu-systems/buildchain/.github/workflows/dev-pr-auto-merge.yml@v4-alpha`.
297
+ The durable selector remains the floating alpha channel, the repository keeps
298
+ matching `.buildchain/contract-lock.json` (`v4`) and
299
+ `.buildchain/alpha-contract-lock.json` (`v4-alpha`), and a train runtime may be
300
+ selected only through the trusted, non-persistent `workflow_dispatch` input.
301
+ No candidate SHA or train ref is persisted in the caller.
302
+
303
+ Only complete `verified-native-qualification` evidence can mint a new Landing
304
+ Warrant. Migrated `legacy-compatibility-only` evidence may preserve an exact
305
+ already-active historical Landing fence, but it cannot create a successor
306
+ Landing or acquire native proof authority.
307
+
308
+ The public command family is explicit:
309
+
310
+ ```sh
311
+ buildchain dev authority migrate --repository owner/repository \
312
+ --branch dev/v4/v4.0 --execute --json
313
+ buildchain dev authority submit --repository owner/repository \
314
+ --branch dev/v4/v4.0 --environment-root <root> \
315
+ --qualification-domains '["<root>"]' ... --execute
316
+ buildchain dev authority lease-qualification --repository owner/repository \
317
+ --branch dev/v4/v4.0 --execute
318
+ buildchain dev authority heartbeat-qualification --repository owner/repository \
319
+ --branch dev/v4/v4.0 --candidate-id <root> \
320
+ --authority-token <root> --authority-generation 1 --execute
321
+ buildchain dev authority complete-qualification --repository owner/repository \
322
+ --branch dev/v4/v4.0 --candidate-id <root> \
323
+ --authority-token <root> --authority-generation 1 \
324
+ --evidence-root <qualification-root> --execute
325
+ buildchain dev authority lease-landing --repository owner/repository \
326
+ --branch dev/v4/v4.0 --execute
327
+ buildchain dev authority heartbeat-landing --repository owner/repository \
328
+ --branch dev/v4/v4.0 --candidate-id <root> \
329
+ --authority-token <root> --authority-generation 1 \
330
+ --provider-attempt admitted-provider-attempt.json --execute
331
+ buildchain dev authority recover --repository owner/repository \
332
+ --branch dev/v4/v4.0 --execute
333
+ buildchain dev authority admit-merge-group --repository owner/repository \
334
+ --branch dev/v4/v4.0 --candidate-id <root> \
335
+ --authority-token <root> --authority-generation 1 \
336
+ --merge-group-head <sha>
337
+ ```
338
+
339
+ Terminal settlement releases either authority immediately from exact evidence;
340
+ it does not wait for TTL. Exact duplicate settlement is a state-root-preserving
341
+ no-op. The default `buildchain dev warrant` commands, v1 state bytes, and
342
+ single-flight behavior do not change while this mode is off.
343
+
344
+ Migration also accepts the historical non-native v1 form whose active Warrant
345
+ predates the `phase` field. It preserves that exact fence as Landing authority
346
+ and records a schema-safe `legacy-compatibility-only` qualification carrying the
347
+ exact legacy state root, token, generation, source proof, and phase. Fields that
348
+ v1 never established remain explicitly null, including the phase-less
349
+ qualification time and every native proof field. A migrated qualified v1
350
+ Warrant retains its historical proof roots as compatibility facts, but
351
+ `nativeProofAuthority` remains false because migration cannot reconstruct the
352
+ v2 execution binding or qualification contract. Neither form can claim new
353
+ native proof or reuse authority. Phase-less native candidates remain invalid.
354
+
145
355
  ## Workflow rollout and rollback
146
356
 
147
357
  The reusable `dev-pr-auto-merge.yml` supports three explicit rollout modes:
148
358
 
149
359
  - `off` preserves the previous exact-head admission controller;
150
360
  - `shadow` qualifies the source and emits a read-only queue submission plan;
151
- - `required` persists the submission, selects the Warrant, and refuses GitHub
152
- enqueue unless the immutable queue commit, state root, active Warrant, and
361
+ - `required` persists the submission, selects a provisional Warrant, runs or
362
+ reuses semantic native proof under heartbeat, atomically qualifies the same
363
+ fence, and refuses GitHub enqueue unless the immutable queue commit, state root, active Warrant, and
153
364
  selected candidate all pass exact readback validation. Immediately before
154
- enqueue, the controller writes and reads back both the exact-head queue
155
- admission status and the active lease status. Only after both are visible at
156
- their required states does it reread the pull request head, protected base,
157
- native merge queue, and current protected Warrant. The final rooted
158
- admission transaction binds the frozen base, source head, Warrant fence and
159
- generation, Project Cut proof, and both status contexts. Status propagation
160
- is retried before enqueue; base, head, predecessor, lease, or Warrant drift
161
- revokes both statuses without attempting enqueue.
365
+ enqueue, the controller writes and then reads back both the exact-head queue
366
+ admission status and active lease status. Only after those statuses are
367
+ visible at their required states does it reread the pull request head,
368
+ protected base, native merge queue, and current protected Warrant state. The
369
+ final rooted admission transaction binds the frozen base, source head,
370
+ candidate, fencing token, generation, native proof roots, Project Cut proof,
371
+ and both status contexts. Status propagation is retried before enqueue;
372
+ base, head, queue-predecessor, lease, or Warrant drift revokes both statuses
373
+ without attempting enqueue. A previously valid result is not authority after terminal
374
+ closeout. Re-running qualification for the same selected head may regenerate
375
+ timestamped proof bytes, but it retains the immutable active Warrant and its
376
+ originally selected proof instead of rewriting or rejecting that attempt.
377
+ Each candidate also retains the exact successful source workflow run. If a
378
+ controller discovers that another candidate owns the active Warrant, a
379
+ configured consumer workflow is dispatched immediately for that exact PR,
380
+ head, source run, Assignment and Initiative, source identity and patch,
381
+ plan, closure, dependency, toolchain, environment, affected paths, delivery
382
+ class, and priority; the candidate is not left waiting for a patrol cron.
383
+ The shipped Buildchain caller and native template configure this handoff path
384
+ and accept the same complete input contract. A historical phase-less owner
385
+ uses the distinct `legacy-phase-less-active-owner` command path. That path
386
+ carries the exact queue state root, fencing token, generation, PR, head, and
387
+ source-run binding, omits `environment-root`, `native-command`, and
388
+ `native-command-root`, and rejects readback drift. It therefore resumes the
389
+ historical non-native authority without inventing a native command contract
390
+ or upgrading the owner to native proof authority.
391
+
392
+ The PR-controlled native candidate runs in a distinct GitHub-hosted job with
393
+ no provider write credential in the step or process ancestry. The dependent
394
+ credentialed finalizer runs on another live-readback-proven GitHub-hosted job
395
+ and runner, verifies the content-addressed transfer, then independently rereads
396
+ the PR, protected base, and provider fence before qualification or settlement.
397
+ Detached descendants, including descendants that unset runner tracking, remain
398
+ in the native runner authority domain and cannot enter the fresh finalizer
399
+ domain. Exit zero alone is never treated as provider mutation authority,
400
+ Landing authority, or completed delivery.
401
+
402
+ Persistent self-hosted runners are intentionally outside this contract. A
403
+ `needs` edge alone does not prove process cleanup or a new authority domain, so
404
+ the finalizer rejects a self-hosted label. Supporting self-hosted execution
405
+ would require separately attested one-job runner destruction and a provider
406
+ readback contract at least as strong as the GitHub-hosted boundary.
162
407
 
163
408
  Required-mode admission also performs a latest-base Project Cut immediately
164
409
  before enqueue. If the protected base advanced, the controller reclassifies
165
- the exact attributed delta against the Warrant-bound source proof. Only a disjoint,
410
+ the exact attributed delta against the rooted native proof. Only a disjoint,
166
411
  fully attributed move may reuse that proof; overlap, unknown attribution,
167
412
  missing composition, or merge conflict fails with a stable pre-enqueue reason.
168
413
  The rooted Project Cut receipt binds the frozen and admitted base SHAs,
@@ -170,6 +415,37 @@ The reusable `dev-pr-auto-merge.yml` supports three explicit rollout modes:
170
415
  head. A final base/head/queue/Warrant compare-and-swap readback must still
171
416
  match that receipt before the enqueue mutation is attempted.
172
417
 
418
+ The protected branch ref is the base authority for that compare-and-swap.
419
+ A pull request's `base.sha` may remain an older composition snapshot while
420
+ GitHub reports the pull request as behind, so it is diagnostic rather than a
421
+ substitute for the separately read protected ref and rooted Project Cut.
422
+
423
+ For a required native delivery class, the reusable controller rejects a
424
+ missing or malformed environment root before runtime checkout, candidate
425
+ submission, Warrant selection, or native execution. The input remains
426
+ conditionally optional so `off`, `shadow`, and `non-native-fast` callers keep
427
+ their documented behavior.
428
+
429
+ The controller persists a completed native proof before its final base
430
+ reclassification. A later exact retry can supply that proof and avoid the
431
+ expensive native command when the rooted delta still proves reuse safe. A
432
+ duplicate dispatch against the same already-qualified Warrant returns the same
433
+ proof and reuse roots plus a rooted qualification replay output without another
434
+ queue mutation. Both result forms carry
435
+ `landingAuthority: false`: only the live qualified Warrant plus exact-head
436
+ GitHub merge-queue admission can authorize landing.
437
+
438
+ The required controller checks the protected base again after native work. A
439
+ disjoint attributed delta reuses the proof. Overlap or unknown attribution
440
+ triggers one automatic revalidation on the latest base; continued overlap,
441
+ native failure, cancellation, semantic head movement, or an unrecoverable merge
442
+ conflict closes the exact fence. The next queued candidate is notified through
443
+ the `buildchain-dev-delivery-wake` repository event. Its complete semantic
444
+ candidate is carried under the single `client_payload.candidate` envelope so
445
+ GitHub's ten-property top-level limit cannot discard proof bindings. If
446
+ cancellation prevents cleanup, lease expiry recovers retained queue age and
447
+ mints a new fence.
448
+
173
449
  Consumers should deploy `shadow` first, inspect receipts, then change their
174
450
  protected caller to `required`. Rollback is a reviewed caller change back to
175
451
  `off`; it does not delete queue history or reinterpret old receipts. The
@@ -178,15 +454,27 @@ merged candidate (or accepts explicit evidence for another terminal outcome),
178
454
  then closes only the current fencing generation. The separate queued
179
455
  cancellation reusable workflow cannot close an active generation; it advances
180
456
  the state ref only when the caller's complete terminal binding and expected-old
181
- root still match.
457
+ root still match. A delayed `dequeued` event is ignored when GitHub readback
458
+ shows the same exact PR head is already queued again, so an earlier queue event
459
+ cannot close a newer active Warrant generation.
182
460
 
183
461
  Buildchain uses the same contract for its own protected dev line through
184
462
  `buildchain-dev-delivery.yml`. The manual caller requires the exact PR head and
185
- all native/source proof roots, pins the runtime to the caller commit, selects
463
+ semantic source roots, accepts an optional reusable native proof, keeps both
464
+ the durable public selector and explicit runtime input on `v4-alpha`, selects
186
465
  `delivery-warrant-mode: required`, and targets GitHub Merge Queue. It does not
187
466
  offer an `off` switch: rollback is a reviewed change to this caller, not an
188
467
  operator-time weakening of a specific delivery attempt.
189
468
 
469
+ `templates/native-dev-delivery.yml` provides the corresponding protected-dev
470
+ consumer workflow. It supports both explicit dispatch and the bounded wake
471
+ event, calls the allowed floating `@v4-alpha` selector, explicitly passes the v4
472
+ runtime ref that locks every delivery job to the same checkout, and keeps the
473
+ native command in the consumer repository rather than inventing
474
+ provider-specific shards. The reusable workflow defaults that explicit input
475
+ to `v4-alpha`; an empty input or any v3 selector fails before the first runtime
476
+ checkout.
477
+
190
478
  This mechanism schedules protected delivery only. It does not serialize local
191
479
  development, source-only checks, unrelated channels, release publication, or
192
480
  runner provisioning. It never grants authority to enable cloud runner