@kungfu-tech/buildchain 4.0.1-alpha.4 → 4.0.1-alpha.5

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 (87) hide show
  1. package/architecture/decisions/0002-next-development-transition.md +101 -0
  2. package/architecture/internal-capabilities.json +52 -3
  3. package/architecture/maintainability-policy.json +22 -10
  4. package/architecture/v3-core-mechanism-inventory.json +89 -0
  5. package/architecture/v4-capability-state-machine-manifest.json +73 -0
  6. package/architecture/v4-compatibility-facts-parity.json +77 -0
  7. package/architecture/v4-next-development-parity.json +192 -0
  8. package/architecture/v4-release-train-parity.json +1 -0
  9. package/architecture/v4-tail-reseal-parity.json +150 -0
  10. package/bin/buildchain.mjs +16 -1
  11. package/bin/internal/command-registry.mjs +2 -0
  12. package/bin/internal/compatibility-facts-cli.mjs +101 -0
  13. package/contracts/fixtures/next-development-transition-v1/anchored-manual-waiting.json +47 -0
  14. package/contracts/fixtures/next-development-transition-v1/semver-auto-planned.json +47 -0
  15. package/contracts/fixtures/next-development-transition-v1/version-model-cases.json +40 -0
  16. package/contracts/fixtures/v4-compatibility-facts-v1/shared.json +1129 -0
  17. package/contracts/fixtures/v4-floating-consumer-policy-v1/cases.json +7 -1
  18. package/contracts/fixtures/v4-tail-reseal-v1/valid.json +229 -0
  19. package/contracts/next-development-request-v1.schema.json +66 -0
  20. package/contracts/next-development-transition-v1.schema.json +292 -0
  21. package/contracts/v4-compatibility-facts-v1.schema.json +230 -0
  22. package/contracts/v4-tail-reseal-v1.schema.json +276 -0
  23. package/dist/site/agent-index.json +1 -0
  24. package/dist/site/artifact-schemas.json +2 -0
  25. package/dist/site/buildchain-contract.json +1388 -23
  26. package/dist/site/buildchain-site.json +257 -19
  27. package/dist/site/capability-registry.json +10 -8
  28. package/dist/site/cli-registry.json +106 -0
  29. package/dist/site/kfd-claims.json +187 -12
  30. package/dist/site/kfd-upstream-aggregate.json +1 -1
  31. package/dist/site/manual-registry.json +35 -4
  32. package/dist/site/node-api-registry.json +6579 -4493
  33. package/dist/site/page-registry.json +233 -11
  34. package/dist/site/public-surface-audit.json +241 -7
  35. package/dist/site/publication-authority-registry.json +6 -1
  36. package/dist/site/publication-registry.json +4 -4
  37. package/dist/site/release-provenance.json +7 -0
  38. package/dist/site/schemas/v4-compatibility-facts-v1.schema.json +230 -0
  39. package/dist/site/site-manifest.json +24 -8
  40. package/dist/site/workflow-registry.json +36 -4
  41. package/docs/MAP.md +4 -1
  42. package/docs/cli-reference.md +125 -0
  43. package/docs/dev-alpha-candidate-patrol.md +8 -0
  44. package/docs/next-development-transition.md +118 -0
  45. package/docs/node-api-reference.md +250 -117
  46. package/docs/v4-compatibility-facts.md +91 -0
  47. package/docs/v4-tail-reseal.md +73 -0
  48. package/docs/versioning.md +4 -3
  49. package/package.json +14 -5
  50. package/packages/core/buildchain-agent-manuals.js +2 -0
  51. package/packages/core/buildchain-compatibility-authority.js +336 -0
  52. package/packages/core/buildchain-compatibility-fact.js +394 -0
  53. package/packages/core/buildchain-compatibility-facts.json +217 -0
  54. package/packages/core/buildchain-compatibility-proof.js +566 -0
  55. package/packages/core/buildchain-contract.js +93 -141
  56. package/packages/core/channel-candidate.js +8 -0
  57. package/packages/core/channel-promotion-baseline.js +55 -0
  58. package/packages/core/dev-alpha-candidate-selection.js +10 -2
  59. package/packages/core/dev-delivery-execution-transfer.js +21 -1
  60. package/packages/core/dev-delivery-process-boundary.js +19 -6
  61. package/packages/core/dev-delivery-provider-heartbeat.js +18 -6
  62. package/packages/core/kungfu-temporal-fact.js +557 -0
  63. package/packages/core/next-development-candidate-reservation.js +186 -0
  64. package/packages/core/next-development-controller.js +728 -0
  65. package/packages/core/next-development-projection.js +287 -0
  66. package/packages/core/next-development-transition.js +738 -0
  67. package/packages/core/paper-agent-entry.js +11 -5
  68. package/packages/core/paper.js +16 -5
  69. package/packages/core/v4-canonical-contracts.js +5 -0
  70. package/packages/core/v4-floating-consumer-policy.js +29 -9
  71. package/packages/core/v4-tail-reseal-contract.js +26 -0
  72. package/packages/core/v4-tail-reseal-github.js +178 -0
  73. package/packages/core/v4-tail-reseal-receipt.js +225 -0
  74. package/packages/core/v4-tail-reseal.js +594 -0
  75. package/scripts/buildchain-cli-help.mjs +20 -0
  76. package/scripts/check-inventory.mjs +11 -0
  77. package/scripts/dev-alpha-candidate-patrol.mjs +22 -1
  78. package/scripts/generate-next-development-guidance.mjs +49 -0
  79. package/scripts/generate-site-bundle.mjs +16 -3
  80. package/scripts/init-repo.mjs +22 -4
  81. package/scripts/next-development-self-dogfood-harness.mjs +460 -0
  82. package/scripts/next-development-self-dogfood.mjs +597 -0
  83. package/scripts/next-development-transition.mjs +47 -0
  84. package/scripts/site-capability-metadata.mjs +12 -0
  85. package/scripts/v4-consumer-policy.mjs +1 -5
  86. package/scripts/v4-tail-reseal-macos-rehearsal.mjs +134 -0
  87. package/scripts/v4-tail-reseal.mjs +416 -0
@@ -0,0 +1,101 @@
1
+ ---
2
+ status: accepted
3
+ period: 2026-08-11
4
+ theme: next-development-transition
5
+ doc_type: architecture-decision-record
6
+ source_level: local-files
7
+ confidence: high
8
+ sensitivity: public
9
+ evidence_grade: A
10
+ review_state: self-reviewed
11
+ last_reviewed: 2026-08-11
12
+ ---
13
+
14
+ # ADR 0002: Alpha Publication and Next-development Are Separate Transactions
15
+
16
+ ## Status
17
+
18
+ Accepted. This decision is normative for Buildchain promotion controllers and
19
+ for generated consumer guidance.
20
+
21
+ ## Context
22
+
23
+ An Alpha publication and preparation of the following development version have
24
+ different trust boundaries. Alpha publication establishes public, immutable
25
+ facts about version N. Preparing N+1 changes repository version material and
26
+ may require a protected pull request or an upstream anchor that does not exist
27
+ when Alpha N completes. Treating both operations as one success condition makes
28
+ a post-publication conflict appear to invalidate a publication that already
29
+ succeeded, and encourages retries to move Alpha refs while repairing Dev.
30
+
31
+ Buildchain supports two legal version models:
32
+
33
+ - `semver` with `next = "auto"`, where N+1 increments the Alpha sequence on
34
+ the same semantic patch; and
35
+ - `anchored` with `next = "manual"`, where no version may be inferred before a
36
+ declared anchor manifest is materialized and rooted.
37
+
38
+ The crossed combinations `semver/manual` and `anchored/auto` have no defined
39
+ meaning and are rejected.
40
+
41
+ ## Decision
42
+
43
+ Alpha publication reaches its own terminal success before a next-development
44
+ transition is created. The transition records the completed Alpha exact tag,
45
+ release commit, tree, publication evidence root, and completion time. A
46
+ deterministic idempotency key covers that completed-Alpha root together with
47
+ the repository, legal version model, and the role-separated adapter path set.
48
+
49
+ The independent next-development state machine is:
50
+
51
+ ```text
52
+ planned ----------------------> materialized -> pr-pending -> merged -> verified
53
+ \ \---------------------------> merged
54
+ -> waiting-anchor ----------> materialized
55
+ ```
56
+
57
+ `semver/auto` derives its target while planned. `anchored/manual` remains in
58
+ `waiting-anchor` until an exact semantic version and the digest of the declared
59
+ anchor manifest are supplied. `pr-pending` is durable incomplete state, not a
60
+ publication failure. Direct materialization may proceed to `merged` or
61
+ `verified` when repository governance does not require a pull request.
62
+
63
+ Every non-initial state transition is compare-and-swap guarded and rooted in
64
+ explicit evidence. Replaying an identical request is a no-op. Alpha outcome is
65
+ always `preserved-success`; no transition may write an Alpha branch, exact tag,
66
+ or floating tag. A controller that needs to repair next-development state may
67
+ write only paths declared by `version.files` and `version.derived_files`; the
68
+ configured anchor manifest is declared read-only authority.
69
+
70
+ ## Local adapter boundary
71
+
72
+ The reference adapter is provider-neutral. It reads the checked-in
73
+ `buildchain.toml`, derives the sorted path allowlist, validates the completed
74
+ Alpha and optional anchor, and plans version-file content. It never invokes Git,
75
+ network clients, lifecycle commands, package registries, or provider APIs.
76
+ Mutation requires explicit `--write`, rejects symlinks and path escapes, and is
77
+ limited to configured `version.files`. The standard repository transaction
78
+ adapter passes the exact target in `BUILDCHAIN_VERSION`, permits changes only
79
+ to `version.files` plus `version.derived_files`, runs
80
+ `lifecycle.version-state` when derived files are declared, and then runs
81
+ `lifecycle.verify`. The reference writer fails closed rather than invoking
82
+ those consumer commands because transaction execution is a separate slice.
83
+ For anchored/manual, the consumer must
84
+ materialize the declared manifest first; the adapter verifies its exact digest
85
+ and does not invent or edit upstream anchor data.
86
+
87
+ Preparing development state alone creates no Git tag, GitHub Release, public
88
+ package, or release candidate.
89
+
90
+ ## Consequences
91
+
92
+ - A completed Alpha N remains successful when N+1 waits for an anchor, a
93
+ protected PR, merge, or verification.
94
+ - Retrying development preparation cannot republish Alpha N or change any
95
+ Alpha ref.
96
+ - Semver and anchored consumers share one lifecycle while retaining their
97
+ distinct version authority.
98
+ - Provider adapters may project pull-request identifiers and merge evidence,
99
+ but those observations do not become part of the local mutation authority.
100
+ - Generated config, Agent instructions, and public documentation are checked
101
+ against the same constants; projection drift fails repository checks.
@@ -6,6 +6,10 @@
6
6
  "bin/internal",
7
7
  "packages/core/release-passport.js",
8
8
  "packages/core/buildchain-contract.js",
9
+ "packages/core/kungfu-temporal-fact.js",
10
+ "packages/core/buildchain-compatibility-fact.js",
11
+ "packages/core/buildchain-compatibility-authority.js",
12
+ "packages/core/buildchain-compatibility-proof.js",
9
13
  "packages/core/workflow-call-contract.js",
10
14
  "packages/core/workflow-yaml-contract.js",
11
15
  "packages/core/paper-fleet.js",
@@ -50,6 +54,12 @@
50
54
  "crates/buildchain-v4-bridge/src/main.rs",
51
55
  "packages/core/v4-runtime-ref-resume-authority.js",
52
56
  "packages/core/v4-runtime-selector-persistence.js",
57
+ "packages/core/v4-tail-reseal-contract.js",
58
+ "packages/core/v4-tail-reseal.js",
59
+ "packages/core/v4-tail-reseal-github.js",
60
+ "packages/core/v4-tail-reseal-receipt.js",
61
+ "scripts/v4-tail-reseal.mjs",
62
+ "scripts/v4-tail-reseal-macos-rehearsal.mjs",
53
63
  "packages/core/v4-provider-operation-journal.js",
54
64
  "packages/core/v4-stage-capsule.js",
55
65
  "packages/core/v4-stage-capsule-store.js",
@@ -106,7 +116,9 @@
106
116
  "packages/core/v4-partial-mutation-recovery-qualification.js",
107
117
  "crates/buildchain-v4-contracts/src/partial_mutation_recovery.rs",
108
118
  "packages/core/v4-adopter-delivery-parity.js",
109
- "crates/buildchain-v4-contracts/src/adopter_delivery.rs"
119
+ "crates/buildchain-v4-contracts/src/adopter_delivery.rs",
120
+ "crates/buildchain-v4-contracts/src/compatibility_facts.rs",
121
+ "crates/buildchain-v4-contracts/src/compatibility_facts"
110
122
  ],
111
123
  "ownershipRules": [
112
124
  {
@@ -512,6 +524,30 @@
512
524
  "docs/dev-delivery-qualification-landing-adr.md"
513
525
  ]
514
526
  },
527
+ {
528
+ "id": "v4-compatibility-facts",
529
+ "owner": "Buildchain compatibility authority maintainers",
530
+ "implementation": [
531
+ "bin/internal/compatibility-facts-cli.mjs",
532
+ "packages/core/kungfu-temporal-fact.js",
533
+ "packages/core/buildchain-compatibility-fact.js",
534
+ "packages/core/buildchain-compatibility-authority.js",
535
+ "packages/core/buildchain-compatibility-proof.js",
536
+ "crates/buildchain-v4-contracts/src/compatibility_facts.rs",
537
+ "crates/buildchain-v4-contracts/src/compatibility_facts/encoding.rs",
538
+ "crates/buildchain-v4-contracts/src/compatibility_facts/fixture.rs",
539
+ "crates/buildchain-v4-contracts/src/compatibility_facts/lifecycle.rs",
540
+ "crates/buildchain-v4-contracts/src/compatibility_facts/verifier.rs"
541
+ ],
542
+ "tests": ["tests/v4-compatibility-facts.test.mjs"],
543
+ "contracts": [
544
+ "architecture/v4-compatibility-facts-parity.json",
545
+ "contracts/v4-compatibility-facts-v1.schema.json",
546
+ "contracts/fixtures/v4-compatibility-facts-v1/shared.json",
547
+ "dist/site/schemas/v4-compatibility-facts-v1.schema.json",
548
+ "docs/v4-compatibility-facts.md"
549
+ ]
550
+ },
515
551
  {
516
552
  "id": "v4-architecture-governance",
517
553
  "owner": "Buildchain architecture maintainers",
@@ -529,6 +565,12 @@
529
565
  "packages/core/v4-adopter-delivery-parity.js",
530
566
  "packages/core/v4-runtime-ref-resume-authority.js",
531
567
  "packages/core/v4-runtime-selector-persistence.js",
568
+ "packages/core/v4-tail-reseal-contract.js",
569
+ "packages/core/v4-tail-reseal.js",
570
+ "packages/core/v4-tail-reseal-github.js",
571
+ "packages/core/v4-tail-reseal-receipt.js",
572
+ "scripts/v4-tail-reseal.mjs",
573
+ "scripts/v4-tail-reseal-macos-rehearsal.mjs",
532
574
  "packages/core/v4-stage-capsule.js",
533
575
  "packages/core/v4-stage-capsule-store.js",
534
576
  "packages/core/v4-stage-capsule-local-store.js",
@@ -562,7 +604,9 @@
562
604
  "tests/v4-platform-stage-checkpoints.test.mjs",
563
605
  "tests/v4-stage-capsule-qualification.test.mjs",
564
606
  "tests/v4-adopter-delivery-parity.test.mjs",
565
- "tests/v4-runtime-ref-resume-authority.test.mjs"
607
+ "tests/v4-runtime-ref-resume-authority.test.mjs",
608
+ "tests/v4-tail-reseal.test.mjs",
609
+ "tests/v4-tail-reseal-parity.test.mjs"
566
610
  ],
567
611
  "contracts": [
568
612
  "architecture/v4-architecture-constitution.md",
@@ -597,8 +641,13 @@
597
641
  "contracts/fixtures/v4-partial-mutation-recovery-v1/shared.json",
598
642
  "contracts/v4-runtime-ref-resume-authority-v1.schema.json",
599
643
  "contracts/fixtures/v4-runtime-ref-resume-authority-v1/scenario.json",
644
+ "architecture/v4-tail-reseal-parity.json",
645
+ "contracts/v4-tail-reseal-v1.schema.json",
646
+ "contracts/fixtures/v4-tail-reseal-v1/valid.json",
647
+ ".github/workflows/v4-tail-reseal.yml",
600
648
  "docs/v4-stage-capsule.md",
601
- "docs/v4-runtime-ref-resume-authority.md"
649
+ "docs/v4-runtime-ref-resume-authority.md",
650
+ "docs/v4-tail-reseal.md"
602
651
  ]
603
652
  }
604
653
  ]
@@ -5,12 +5,12 @@
5
5
  "enforcementRevision": "5308189b09bcb5a1314195412f2807a40d678838",
6
6
  "repositoryBudgets": {
7
7
  "baselineRevision": "c70e6ac28431888b24fefc218246cc69f8dde85a",
8
- "maxHandMaintainedSourceFiles": 384,
9
- "maxHandMaintainedSourceLines": 146550,
10
- "maxWorkflowFiles": 71,
11
- "maxWorkflowLines": 25259,
12
- "latestTransition": "Delivery authority now migrates a rechecked live v1 ref with the configured v2 policy, rejects GitHub artifact runtime credentials in candidate ancestry, binds containment comparison to the exact protected-base head, and keeps v2 migration promises out of the v1 workflow contract.",
13
- "rationale": "Bounded modules separate candidate, evidence, native proof and execution, canonical failure verification, closed-set execution transfer, process-boundary verification, Warrant state and qualification, authority state, qualification, Landing acquisition, verified-attempt admission, Landing settlement and fence validation, provider attempt and heartbeat readback, sealed terminal evidence, hosted heartbeat, resume, store, options, command-specific adapters, and CLI orchestration responsibilities. The protected delivery workflow gives candidate and seal jobs no provider write credential, recursively rejects transfer drift, scopes every transfer artifact to the exact provider run attempt, chains every durable heartbeat state and receipt root on a distinct hosted runner domain, and permits qualification or exact failure settlement only after the finalizer verifies live jobs and the latest durable authority state. Public Landing admission and heartbeat always perform non-injectable fresh exact-attempt provider readback, and heartbeat-loss coordination never invokes GitHub's run-scoped cancellation API where a successor rerun could race. V2 mutation cannot initialize a second empty authority beside a legacy ref: migration reads and roots the canonical live v1 ref, rechecks it, applies the explicit configured v2 policy, and atomically replaces its bytes through one expected-old non-force update, so old v1 controllers fail closed while the prior commit remains immutable history. Candidate ancestry classifies the GitHub artifact runtime token as credential authority. Every Landing settlement, including an unexpired fence, requires product-owned terminal readback. Terminal cleanup reads the immutable historical attempt, derives workflow and hosted Landing job identity from live run data, reads the exact protected ref head and compares containment against that immutable SHA, and seals merged only when the admitted merge-group head is contained by that protected base; a later different-head merge settles the old attempt as dequeued. Terminal normalization preserves transfer, finalizer boundary, native and seal job, admitted provider attempt, protected-base head, containment result, and terminal readback coordinates. The public reusable workflow truthfully retains its single-flight v1 authority without advertising v2 migration, while bounded v2 remains a separate opt-in CLI, Node API, and schema contract; the tracked self-caller stays on public v4-alpha with matching stable and alpha locks, and transient train selection is dispatch-only. These exact 384-file, 146550-source-line and 25259-workflow-line ceilings cannot grow implicitly."
8
+ "maxHandMaintainedSourceFiles": 408,
9
+ "maxHandMaintainedSourceLines": 154384,
10
+ "maxWorkflowFiles": 72,
11
+ "maxWorkflowLines": 25634,
12
+ "latestTransition": "Compatibility Facts parity adds a closed public schema, split Rust and TypeScript KFR2 cores, append-only lifecycle verification, shared fail-closed fixtures, CLI and Node projections, Release Passport lineage evidence, and generated site facts.",
13
+ "rationale": "Bounded modules separate candidate, evidence, native proof and execution, canonical failure verification, closed-set execution transfer, process-boundary verification, Warrant state and qualification, authority state, qualification, Landing acquisition, verified-attempt admission, Landing settlement and fence validation, provider attempt and heartbeat readback, sealed terminal evidence, hosted heartbeat, resume, store, options, command-specific adapters, and CLI orchestration responsibilities. The protected delivery workflow gives candidate and seal jobs no provider write credential, recursively rejects transfer drift, scopes every transfer artifact to the exact provider run attempt, chains every durable heartbeat state and receipt root on a distinct hosted runner domain, and permits qualification or exact failure settlement only after the finalizer verifies live jobs and the latest durable authority state. Public Landing admission and heartbeat always perform non-injectable fresh exact-attempt provider readback, tolerate only a not-yet-materialized seal job while retaining exact native and duplicate-job rejection, and heartbeat-loss coordination never invokes GitHub's run-scoped cancellation API where a successor rerun could race. The hosted process boundary anchors trust in the kernel-resolved versioned Runner.Worker path while accepting an equivalent argv-zero spelling with the same basename; its public boundary marker is allowed only at the one exact non-secret value, so a forged value under the same credential-like name still fails closed. The credentialless transfer seal validates the rooted native reuse decision against the Warrant-bound source, closure, dependency, toolchain, environment and command inputs; qualifiedBase stays in the proof and decision where it is rooted and later independently rechecked, rather than being assumed on the Warrant schema. V2 mutation cannot initialize a second empty authority beside a legacy ref: migration reads and roots the canonical live v1 ref, rechecks it, applies the explicit configured v2 policy, and atomically replaces its bytes through one expected-old non-force update, so old v1 controllers fail closed while the prior commit remains immutable history. Candidate ancestry classifies the GitHub artifact runtime token as credential authority. Every Landing settlement, including an unexpired fence, requires product-owned terminal readback. Terminal cleanup reads the immutable historical attempt, derives workflow and hosted Landing job identity from live run data, reads the exact protected ref head and compares containment against that immutable SHA, and seals merged only when the admitted merge-group head is contained by that protected base; a later different-head merge settles the old attempt as dequeued. Terminal normalization preserves transfer, finalizer boundary, native and seal job, admitted provider attempt, protected-base head, containment result, and terminal readback coordinates. The public reusable workflow truthfully retains its single-flight v1 authority without advertising v2 migration, while bounded v2 remains a separate opt-in CLI, Node API, and schema contract; the tracked self-caller stays on public v4-alpha with matching stable and alpha locks, and transient train selection is dispatch-only. Next-development parity adds one versioned transition authority, one durable controller, one bounded reservation adapter, and pure public-contract recovery evidence while retaining the existing thin floating-channel callers byte-for-byte. The floating-consumer gate reuses the existing contract-world evaluator so SHA drift passes only under the selected lock's compatibility policy, breaking surface drift still fails closed, and external certification reconstructs the receipt from the observed workflow SHA rather than the lock's historical evidence SHA. Tail reseal adds no Stage Capsule effect or general rebuild authority: it verifies the exact retained four-platform bytes, admits one known macOS tail failure through live provider readback, fences signing and finalization to explicit credentials and Warrant identity, and requires standard candidate Passport plus provider and protected readback. Compatibility Facts parity isolates canonical encoding, temporal verification, lifecycle validation, fixture projection, public authority projection, and CLI adaptation into bounded modules; legacy digest and proof arrays are derived only from exact current Fact lineage. These exact 408-file, 154384-source-line, 72-workflow-file and 25634-workflow-line ceilings cannot grow implicitly."
14
14
  },
15
15
  "sourceBudgets": {
16
16
  "newFileLines": 600,
@@ -19,6 +19,18 @@
19
19
  "existingDebtPolicy": "no-widening"
20
20
  },
21
21
  "approvedNewFileTransitions": {
22
+ "packages/core/next-development-transition.js": {
23
+ "maxLines": 738,
24
+ "rationale": "The single versioned authority keeps completed-Alpha identity, legal successor models, role-separated adapter bounds, materialization roots, compare-and-swap transitions and deterministic replay validation together. Anchored and manual initial state persists as waiting-anchor after reviewed input and exposes rooted anchor binding plus controller materialization recording; this exact reviewed ceiling cannot grow implicitly."
25
+ },
26
+ "packages/core/next-development-controller.js": {
27
+ "maxLines": 728,
28
+ "rationale": "The durable controller keeps atomic child identity, rooted checkpoints, idempotent materialization operations, latest protected Dev revalidation, PR settlement and exact source and derived root readback in one provider-neutral authority. It exposes no Alpha publication effect and resumes only through injected atomic store and executor boundaries; this exact reviewed ceiling cannot grow implicitly."
29
+ },
30
+ "actions/promote-buildchain-ref/internal/promote-alpha-channel.js": {
31
+ "maxLines": 599,
32
+ "rationale": "The extracted Alpha promotion stage replaces the former non-fast-forward skip with the existing exact-current-Dev regeneration contract, protected PR fallback, and fail-closed workspace binding; this exact reviewed ceiling cannot grow implicitly."
33
+ },
22
34
  "scripts/dev-delivery-source-proof-reuse.mjs": {
23
35
  "maxLines": 631,
24
36
  "rationale": "The bounded source-proof driver seals one exact PR qualification and verifies either the reviewed two-parent merge or GitHub's exact linear replay by base ancestry, commit count and every intermediate tree. Unknown, nonlinear, extra-commit or tree-drift compositions still fail closed to the full lifecycle, and this exact file ceiling cannot grow implicitly."
@@ -131,8 +143,8 @@
131
143
  "rationale": "The new-file budget evaluator recognizes only explicit path-scoped transitions with exact ceilings and mandatory rationales; the default budget and every existing no-widening check remain unchanged."
132
144
  },
133
145
  "scripts/check-inventory.mjs": {
134
- "maxLines": 1486,
135
- "rationale": "Inventory retains the recovery, sealed-bundle, no-product-install, and durable-finalization checks, requires the self-dogfood lock to match the current major, and binds every channel-router lane to the exact caller shell without unresolved static channel refs. This exact post-integration ceiling cannot grow implicitly."
146
+ "maxLines": 1497,
147
+ "rationale": "Inventory retains the complete recovery and publication authority set and additionally requires both bounded next-development self-dogfood command and harness files beside the contract, controller, schemas, fixtures, adapter, generated guidance and public documentation; this exact post-integration ceiling cannot grow implicitly."
136
148
  },
137
149
  "scripts/generate-channel-promotion-workflow.mjs": {
138
150
  "maxFunctionLines": 290,
@@ -149,8 +161,8 @@
149
161
  "rationale": "The existing Gate validator admits an explicit bounded long-form duration class while preserving the standard 60-second default and exact capture-to-scene binding; this exact post-integration ceiling cannot grow implicitly."
150
162
  },
151
163
  "scripts/dev-alpha-candidate-patrol.mjs": {
152
- "maxLines": 1184,
153
- "rationale": "The existing single-flight exact-source Alpha controller now idempotently registers repository-selected GitHub auto-merge intent only after settlement revalidation, with explicit merge-method validation and no direct merge or approval path; this exact ceiling cannot grow implicitly."
164
+ "maxLines": 1197,
165
+ "rationale": "The existing single-flight exact-source Alpha controller delegates next-development reservation validation to the bounded core reader, carries the rooted result into selection, and retains the no-publication boundary; this exact ceiling cannot grow implicitly."
154
166
  },
155
167
  "scripts/build-contract-core.mjs": {
156
168
  "maxLines": 1229,
@@ -69,6 +69,11 @@
69
69
  "root": "packages/core",
70
70
  "pattern": "^release-activation-transaction\\.js$"
71
71
  },
72
+ {
73
+ "mechanismId": "next-development-controller",
74
+ "root": "packages/core",
75
+ "pattern": "^next-development-(?:transition|controller|candidate-reservation)\\.js$"
76
+ },
72
77
  {
73
78
  "mechanismId": "publication-authority",
74
79
  "root": "packages/core",
@@ -130,6 +135,90 @@
130
135
  "orphanPolicy": "Every state-bearing mechanism must own source, tests, public surfaces, durable-store disposition, recovery, and v4 migration disposition; missing or ambiguous ownership fails validation."
131
136
  },
132
137
  "mechanisms": [
138
+ {
139
+ "id": "next-development-controller",
140
+ "owner": "Buildchain protected development version plane",
141
+ "writers": [
142
+ "completed Alpha terminal-success schedulers",
143
+ "packages/core/next-development-controller.js"
144
+ ],
145
+ "schemas": [
146
+ "kungfu-buildchain-next-development-transition/v1",
147
+ "kungfu-buildchain-next-development-controller/v1"
148
+ ],
149
+ "stores": [
150
+ "atomic child store keyed by repository and completed-Alpha root",
151
+ "compare-and-swap rooted controller checkpoints"
152
+ ],
153
+ "states": [
154
+ "planned",
155
+ "waiting-anchor",
156
+ "materialized",
157
+ "pr-pending",
158
+ "merged",
159
+ "verified"
160
+ ],
161
+ "events": [
162
+ "schedule",
163
+ "bind-reviewed-anchor",
164
+ "materialize-current-dev",
165
+ "open-protected-version-pr",
166
+ "record-merge",
167
+ "verify-protected-dev-readback"
168
+ ],
169
+ "transitions": [
170
+ "one completed Alpha creates or reuses one deterministic durable child",
171
+ "stale Dev material is superseded before protected delivery",
172
+ "merged reaches verified only after exact source and derived root readback"
173
+ ],
174
+ "recovery": [
175
+ "fresh runners load the durable child and resume the last rooted checkpoint",
176
+ "idempotent materialization operation keys reuse effects after lost responses"
177
+ ],
178
+ "effects": [
179
+ "declared source and derived version material",
180
+ "protected Dev version pull request"
181
+ ],
182
+ "retry": [
183
+ "Dev movement supersedes only the stale materialization attempt",
184
+ "readback mismatch remains merged and retries observation without rebuilding"
185
+ ],
186
+ "invalidation": [
187
+ "completed Alpha identity drift",
188
+ "undeclared changed path",
189
+ "durable compare-and-swap conflict",
190
+ "protected Dev version or root disagreement"
191
+ ],
192
+ "providerReadback": [
193
+ "latest protected Dev SHA",
194
+ "protected version PR status",
195
+ "protected Dev ancestry, target version, source roots, and derived roots"
196
+ ],
197
+ "publicSurfaces": [
198
+ "cli:next-development",
199
+ "export:./next-development-transition",
200
+ "export:./next-development-controller",
201
+ "export:./next-development-projection"
202
+ ],
203
+ "compatibilityCallers": [
204
+ "v4 completed-Alpha schedulers through the atomic store and executor interfaces"
205
+ ],
206
+ "sourcePaths": [
207
+ "packages/core/next-development-transition.js",
208
+ "packages/core/next-development-controller.js",
209
+ "packages/core/next-development-candidate-reservation.js"
210
+ ],
211
+ "testPaths": [
212
+ "tests/next-development-transition.test.mjs",
213
+ "tests/next-development-controller.test.mjs",
214
+ "tests/dev-alpha-candidate-patrol.test.mjs",
215
+ "tests/next-development-self-dogfood.test.mjs"
216
+ ],
217
+ "migrationDisposition": "v4-authoritative-with-public-consumer-lifecycle-proof",
218
+ "unresolved": [
219
+ "provider-specific durable-store retention and workflow wake policy remain caller-owned integration choices"
220
+ ]
221
+ },
133
222
  {
134
223
  "id": "dev-delivery-warrant",
135
224
  "owner": "Buildchain Dev delivery control plane",
@@ -83,6 +83,18 @@
83
83
  }
84
84
  },
85
85
  "capabilities": [
86
+ {
87
+ "id": "next-development-controller",
88
+ "owner": "Buildchain protected development version plane",
89
+ "sourceInventoryId": "next-development-controller",
90
+ "surfaces": [
91
+ "cli:next-development",
92
+ "export:./next-development-transition",
93
+ "export:./next-development-controller",
94
+ "export:./next-development-projection"
95
+ ],
96
+ "migrationPhase": "legacy-retired"
97
+ },
86
98
  {
87
99
  "id": "dev-delivery-warrant",
88
100
  "owner": "Buildchain Dev delivery control plane",
@@ -198,6 +210,67 @@
198
210
  }
199
211
  ],
200
212
  "stateMachines": [
213
+ {
214
+ "id": "next-development-controller",
215
+ "capabilityId": "next-development-controller",
216
+ "owner": "Buildchain protected development version plane",
217
+ "writer": {
218
+ "runtime": "typescript-v4",
219
+ "authoritative": true,
220
+ "secondWriterBudget": 0
221
+ },
222
+ "schemas": [
223
+ "kungfu-buildchain-next-development-transition/v1",
224
+ "kungfu-buildchain-next-development-controller/v1"
225
+ ],
226
+ "store": "atomic child store with compare-and-swap rooted checkpoints",
227
+ "states": [
228
+ "planned",
229
+ "waiting-anchor",
230
+ "materialized",
231
+ "pr-pending",
232
+ "merged",
233
+ "verified"
234
+ ],
235
+ "events": [
236
+ "schedule",
237
+ "bind-reviewed-anchor",
238
+ "materialize-current-dev",
239
+ "open-protected-version-pr",
240
+ "record-merge",
241
+ "verify-protected-dev-readback"
242
+ ],
243
+ "invariants": [
244
+ "completed Alpha remains terminal and immutable",
245
+ "one deterministic child exists per completed-Alpha root",
246
+ "verified requires exact protected Dev version and root readback"
247
+ ],
248
+ "effects": [
249
+ "write declared version source and derived material",
250
+ "request one protected Dev version pull request"
251
+ ],
252
+ "adapters": [
253
+ "atomic durable child store",
254
+ "version-state materialization adapter",
255
+ "protected Dev pull-request and readback adapter"
256
+ ],
257
+ "tests": [
258
+ "tests/next-development-transition.test.mjs",
259
+ "tests/next-development-controller.test.mjs",
260
+ "tests/next-development-self-dogfood.test.mjs",
261
+ "tests/dev-alpha-candidate-patrol.test.mjs"
262
+ ],
263
+ "recovery": [
264
+ "fresh runners resume the last rooted checkpoint and reuse idempotent materialization operations",
265
+ "moved protected Dev supersedes only stale preparation and readback mismatch retries observation"
266
+ ],
267
+ "migrationPhase": "legacy-retired",
268
+ "budgets": {
269
+ "undeclaredStates": 0,
270
+ "undeclaredEvents": 0,
271
+ "unboundedRetries": 0
272
+ }
273
+ },
201
274
  {
202
275
  "id": "dev-delivery-warrant",
203
276
  "capabilityId": "dev-delivery-warrant",
@@ -0,0 +1,77 @@
1
+ {
2
+ "schema": "buildchain.v4.compatibility-facts-parity/v1",
3
+ "source": {
4
+ "branch": "dev/v3/v3.0",
5
+ "commit": "6b96bdad8d9f8ccf9275f27d9370a226a9c78465",
6
+ "factRegistry": "packages/core/buildchain-compatibility-facts.json"
7
+ },
8
+ "target": {
9
+ "branch": "dev/v4/v4.0",
10
+ "commit": "60e61d0a17bdf41262454a3499aae430248036fc",
11
+ "schema": "contracts/v4-compatibility-facts-v1.schema.json"
12
+ },
13
+ "rootProtocol": "kungfu.fact-root.canonical/v2",
14
+ "matrixRoot": "sha256:be099fcb4ecc5ec0bf24e86853246d12210b2f6d082e928ce90a40b00345f262",
15
+ "matrix": [
16
+ {
17
+ "invariant": "immutable-directional-relation",
18
+ "v3": "source-to-target Fact",
19
+ "v4": "source-to-target Fact",
20
+ "parity": "exact"
21
+ },
22
+ {
23
+ "invariant": "operation-scope",
24
+ "v3": "accept-contract-lock",
25
+ "v4": "accept-contract-lock",
26
+ "parity": "exact"
27
+ },
28
+ {
29
+ "invariant": "time-awareness",
30
+ "v3": "validFromCutRoot plus Cut ancestry",
31
+ "v4": "validFromCutRoot plus Cut ancestry",
32
+ "parity": "exact"
33
+ },
34
+ {
35
+ "invariant": "append-only-current-truth",
36
+ "v3": "supersede and revoke records",
37
+ "v4": "supersede and revoke records",
38
+ "parity": "exact"
39
+ },
40
+ {
41
+ "invariant": "explicit-path",
42
+ "v3": "direct default and explicit bounded composition",
43
+ "v4": "direct default and explicit bounded composition",
44
+ "parity": "exact"
45
+ },
46
+ {
47
+ "invariant": "negative-receipts",
48
+ "v3": "rooted accepted or rejected path receipt",
49
+ "v4": "byte-identical Rust and TypeScript receipt",
50
+ "parity": "safety-equivalent"
51
+ },
52
+ {
53
+ "invariant": "legacy-digest-projection",
54
+ "v3": "compatibleBreakingDigests derived from proofs and Facts",
55
+ "v4": "exact-target current Facts derive digest arrays",
56
+ "parity": "safety-equivalent"
57
+ },
58
+ {
59
+ "invariant": "legacy-proof-projection",
60
+ "v3": "v1 proof roots retained",
61
+ "v4": "v1 proof roots retained as non-authoritative lineage",
62
+ "parity": "exact"
63
+ },
64
+ {
65
+ "invariant": "release-passport",
66
+ "v3": "Fact lineage available to verification receipt",
67
+ "v4": "Fact, Cut, proof and path roots attach as non-release-authority evidence",
68
+ "parity": "safety-equivalent"
69
+ },
70
+ {
71
+ "invariant": "unknown-state",
72
+ "v3": "fail closed",
73
+ "v4": "missing ambiguous expired revoked wrong-direction wrong-Cut disconnected and corrupt fail closed",
74
+ "parity": "exact"
75
+ }
76
+ ]
77
+ }