@kungfu-tech/buildchain 3.0.6 → 3.0.7-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/README.md +4 -2
  2. package/actions/promote-buildchain-ref/README.md +10 -0
  3. package/actions/release-tail/README.md +17 -0
  4. package/bin/buildchain.mjs +11 -0
  5. package/bin/internal/command-registry.mjs +2 -0
  6. package/contracts/auditable-demo-scenario-v1.schema.json +1 -1
  7. package/contracts/engineering-housekeeper-v1.schema.json +143 -0
  8. package/contracts/fixtures/engineering-housekeeper-v1/cases.json +68 -0
  9. package/contracts/fixtures/release-tail-capabilities-v1/kungfu-alpha.json +273 -0
  10. package/contracts/publication-rehearsal-capsule-v1.schema.json +173 -0
  11. package/contracts/release-tail-capabilities-v1.schema.json +199 -0
  12. package/contracts/release-tail-provider-bindings-v1.schema.json +56 -0
  13. package/dist/site/agent-index.json +3 -0
  14. package/dist/site/artifact-schemas.json +6 -0
  15. package/dist/site/buildchain-contract.json +42 -27
  16. package/dist/site/buildchain-site.json +384 -33
  17. package/dist/site/capability-registry.json +15 -12
  18. package/dist/site/cli-registry.json +102 -0
  19. package/dist/site/controller-registry.json +19 -3
  20. package/dist/site/kfd-claims.json +359 -17
  21. package/dist/site/kfd-upstream-aggregate.json +1 -1
  22. package/dist/site/manual-registry.json +53 -7
  23. package/dist/site/node-api-registry.json +5882 -3605
  24. package/dist/site/page-registry.json +348 -21
  25. package/dist/site/public-surface-audit.json +396 -16
  26. package/dist/site/publication-authority-registry.json +106 -1
  27. package/dist/site/publication-registry.json +4 -4
  28. package/dist/site/release-provenance.json +7 -0
  29. package/dist/site/schemas/publication-rehearsal-capsule-v1.schema.json +269 -0
  30. package/dist/site/schemas/release-tail-capabilities-v1.schema.json +353 -0
  31. package/dist/site/schemas/release-tail-provider-bindings-v1.schema.json +94 -0
  32. package/dist/site/site-manifest.json +35 -11
  33. package/dist/site/workflow-registry.json +204 -10
  34. package/docs/MAP.md +6 -2
  35. package/docs/auditable-demo.md +2 -2
  36. package/docs/cli-reference.md +136 -0
  37. package/docs/dev-delivery-warrant.md +49 -4
  38. package/docs/engineering-housekeeper.md +138 -0
  39. package/docs/lifecycle-protocol.md +4 -2
  40. package/docs/node-api-reference.md +495 -281
  41. package/docs/publication-rehearsal.md +94 -0
  42. package/docs/release-governance.md +17 -2
  43. package/docs/release-tail-contract.md +160 -0
  44. package/docs/release-tail-provider-plane.md +120 -0
  45. package/docs/reusable-build-surface.md +11 -0
  46. package/package.json +11 -3
  47. package/packages/core/artifact-signing.js +61 -0
  48. package/packages/core/buildchain-agent-manuals.js +3 -0
  49. package/packages/core/buildchain-config.js +66 -6
  50. package/packages/core/buildchain-kfd-claims.js +1 -1
  51. package/packages/core/buildchain-publication-authority.js +5 -0
  52. package/packages/core/controller-evidence.js +2 -1
  53. package/packages/core/dev-delivery-warrant-cancellation.js +1 -0
  54. package/packages/core/dev-delivery-warrant-shadow.js +502 -0
  55. package/packages/core/dev-delivery-warrant.js +15 -6
  56. package/packages/core/diagnostics.js +8 -3
  57. package/packages/core/engineering-housekeeper-github-client.js +222 -0
  58. package/packages/core/engineering-housekeeper-github.js +501 -0
  59. package/packages/core/engineering-housekeeper.js +259 -0
  60. package/packages/core/index.js +42 -0
  61. package/packages/core/kfd-gate.js +45 -15
  62. package/packages/core/paper-agent-entry.js +11 -5
  63. package/packages/core/paper-repository.js +1 -0
  64. package/packages/core/paper-scaffold-content.js +21 -0
  65. package/packages/core/paper.js +28 -2
  66. package/packages/core/publication-rehearsal-projection.js +173 -0
  67. package/packages/core/publication-rehearsal-runtime.js +921 -0
  68. package/packages/core/release-passport.js +130 -20
  69. package/packages/core/release-tail-compatibility.js +60 -0
  70. package/packages/core/release-tail-provider-adapters.js +461 -0
  71. package/packages/core/release-tail-provider-plane.js +1228 -0
  72. package/scripts/assemble-publication-artifact-admission.mjs +1 -1
  73. package/scripts/assemble-self-publication-admission.mjs +2 -2
  74. package/scripts/audit-publication-control-plane.mjs +1 -1
  75. package/scripts/auditable-demo-bundle-verification.mjs +2 -3
  76. package/scripts/auditable-demo-platform.mjs +2 -2
  77. package/scripts/auditable-demo-renditions.mjs +1 -1
  78. package/scripts/auditable-demo.mjs +2 -2
  79. package/scripts/build-contract-core.mjs +8 -3
  80. package/scripts/build-standalone-binary.mjs +14 -3
  81. package/scripts/buildchain-cli-help.mjs +13 -0
  82. package/scripts/check-core-mechanism-inventory.mjs +347 -0
  83. package/scripts/check-inventory.mjs +10 -8
  84. package/scripts/check-maintainability.mjs +9 -2
  85. package/scripts/check-release-tail-contract.mjs +435 -0
  86. package/scripts/dev-delivery-warrant.mjs +31 -4
  87. package/scripts/dev-pr-auto-merge.mjs +30 -4
  88. package/scripts/dev-pr-delivery-warrant.mjs +50 -0
  89. package/scripts/engineering-housekeeper-workflow.mjs +394 -0
  90. package/scripts/generate-channel-promotion-workflow.mjs +10 -8
  91. package/scripts/generate-site-bundle.mjs +47 -4
  92. package/scripts/init-repo.mjs +26 -2
  93. package/scripts/inspect-artifact-signing-requests.mjs +6 -0
  94. package/scripts/materialize-self-release-candidate-version.mjs +137 -0
  95. package/scripts/publication-commit-evidence.mjs +69 -23
  96. package/scripts/release-candidate-resolver.mjs +16 -10
  97. package/scripts/release-tail.mjs +159 -0
  98. package/scripts/resume-from-candidate-run.mjs +123 -9
  99. package/scripts/seal-artifact-signing-requests.mjs +6 -0
  100. package/scripts/site-capability-metadata.mjs +13 -0
  101. package/scripts/v4-architecture.mjs +600 -0
  102. package/scripts/web-surface-core.mjs +8 -2
  103. package/scripts/workflow-call-contract.mjs +184 -5
@@ -0,0 +1,94 @@
1
+ ---
2
+ status: preview
3
+ period: 2026-08-08
4
+ theme: buildchain-publication-rehearsal
5
+ doc_type: product-manual
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-08
12
+ ai_provenance:
13
+ model_family: GPT-5
14
+ product: Codex
15
+ generated_at: 2026-08-08
16
+ visible_context: Public rehearsal capsule runtime, release-tail provider plane, CLI, Action, workflow, and generated consumer surfaces.
17
+ invisible_context_boundary: No credentials, private provider state, signed URLs, or external publication receipts were read.
18
+ ---
19
+
20
+ # Publication rehearsal
21
+
22
+ Buildchain publication rehearsal runs the deterministic release tail locally
23
+ from one `kungfu.buildchain.publication-rehearsal-capsule/v1` document. The
24
+ normative rule is [ADR 0001](../architecture/decisions/0001-release-local-constructibility.md):
25
+ every non-external release behavior must be locally constructible, and no
26
+ semantic path may depend on GitHub runner state.
27
+
28
+ The machine-readable shape is
29
+ [`publication-rehearsal-capsule-v1.schema.json`](../contracts/publication-rehearsal-capsule-v1.schema.json).
30
+
31
+ ## Exact local command
32
+
33
+ Run from the repository root after restoring the content-addressed candidate:
34
+
35
+ ```sh
36
+ buildchain release-tail rehearse \
37
+ --capsule "$PWD/.buildchain/publication/rehearsal-capsule.json" \
38
+ --capsule-root "$PWD/.buildchain/publication/candidate" \
39
+ --mode simulate \
40
+ --state "$PWD/.buildchain/publication/rehearsal-state.json" \
41
+ --evidence "$PWD/.buildchain/publication/rehearsal-evidence.json"
42
+ ```
43
+
44
+ Use `--mode replay` only when the capsule contains a complete recorded
45
+ provider-response sequence. Both modes produce rooted evidence with
46
+ `externalPublicationClaimed: false`.
47
+
48
+ ## Daily fixture and sealed-candidate modes
49
+
50
+ For daily development, build a synthetic capsule with
51
+ `createPublicationRehearsalCapsule`, use synthetic files and provider
52
+ observations, and run `--mode simulate` or `--mode replay`. This fixture mode is
53
+ for deterministic regression evidence only.
54
+
55
+ Before publication qualification, restore the exact sealed candidate bytes,
56
+ Passport, policy roots, initial transaction and recorded observations named by
57
+ the retained capsule, then run the exact command above. Preserve the resulting
58
+ binding root, transaction root, state root, receipt roots and evidence root.
59
+ These roots qualify deterministic construction only; external publication and
60
+ public readback still require their own authorities.
61
+
62
+ ## Capsule contents
63
+
64
+ The capsule root commits to the release-tail declaration, ordered policy roots,
65
+ Passport path/root, initial durable transaction, complete file inventory,
66
+ data-only provider bindings, recorded observations, portable platform policy,
67
+ declared environment keys, and the exact list of external effects. Every input
68
+ file is a regular non-symlink file under the explicit absolute capsule root and
69
+ must match its size and SHA-256 root.
70
+
71
+ The CLI never reads `GITHUB_*`, infers a runner workspace, selects behavior from
72
+ `process.platform`, or accepts executable hooks. An explicit environment JSON
73
+ object must match the capsule declaration exactly.
74
+
75
+ ## Hosted parity
76
+
77
+ The reusable `release-tail.yml` workflow passes the explicit capsule to the
78
+ `actions/release-tail` wrapper. The wrapper supplies only GitHub/HTTP transport
79
+ and declared secret inputs, then invokes the same
80
+ `executePublicationRehearsal` public core used locally. Provider requests,
81
+ responses, failures, transaction roots, receipt roots, and the final evidence
82
+ root are retained together.
83
+
84
+ Simulation or replay is development evidence. Provider mode can record real
85
+ external observations, but it still does not replace Release Passport,
86
+ attestation, registry, activation, public-readback, or protected-delivery
87
+ authority.
88
+
89
+ ## Failure handling
90
+
91
+ Diagnostics use
92
+ `kungfu.buildchain.publication-rehearsal-diagnostic/v1`. Preserve the capsule,
93
+ diagnostic root, binding root, and exact failed files. Repair the shared core or
94
+ capsule locally and rerun before spending another hosted runner attempt.
@@ -610,6 +610,12 @@ The reusable caller supports `off`, read-only `shadow`, and fail-closed
610
610
  `required` rollout modes. GitHub Merge Queue remains the final protected-ref
611
611
  authority in every mode.
612
612
 
613
+ Bounded-concurrency experiments use the separate effect-disabled Warrant
614
+ shadow planner. It may evaluate at most two fully bound lanes from one exact
615
+ observation, but it cannot mint a second production Warrant or mutate GitHub.
616
+ Its aggregate threshold decision is qualification evidence for a later rollout
617
+ change, not authority to change the live single-flight policy.
618
+
613
619
  The canonical consumer required check context is `check / check`, matching the
614
620
  reusable workflow call plus its `check` job. Buildchain's own `Verify` workflow
615
621
  emits the repository-local context `check`, so Buildchain self-promotion,
@@ -785,6 +791,12 @@ active semver dev line, so consumers do not pin patrol to a stale minor branch.
785
791
  The separate workflow names keep consumer schedules readable and stable while
786
792
  Buildchain adds new checks behind the cadence wrappers.
787
793
 
794
+ Branch and pull-request residue uses the separate
795
+ [`Engineering Housekeeper`](engineering-housekeeper.md) contract. Its scheduled
796
+ callers are report-only and read-only by default; apply requires a manual,
797
+ explicit two-part gate, exact provider-state revalidation, scoped job
798
+ permissions, and rooted plan/report/receipt evidence.
799
+
788
800
  ## Package-Manager Adapters
789
801
 
790
802
  Old ABV assumed JavaScript repositories with root version state and often
@@ -816,8 +828,11 @@ declare version-state files and lifecycle commands without pretending every
816
828
  project is a Node workspace. Supported version files include JSON, TOML, and
817
829
  regex-based files such as `CMakeLists.txt` or `conanfile.py`.
818
830
 
819
- The promotion action consumes `version.files`, optional anchored/manual
820
- `version.derived_files`, and `lifecycle.verify`.
831
+ The promotion action consumes `version.files`, optional
832
+ `version.derived_files`, and `lifecycle.verify`. Semver and anchored/manual
833
+ repositories may both declare lifecycle-regenerated tracked outputs as derived
834
+ files; anchored/manual repositories additionally bind them into their committed
835
+ version witnesses.
821
836
  The verify stage runs after generated version-state changes are applied locally
822
837
  and before any release refs move. If `verification-command` is passed directly
823
838
  to the action, that explicit command overrides `lifecycle.verify`.
@@ -0,0 +1,160 @@
1
+ ---
2
+ status: draft
3
+ period: 2026-08-07
4
+ theme: buildchain-release-tail-contract
5
+ doc_type: architecture
6
+ source_level: local-files
7
+ confidence: high
8
+ sensitivity: public
9
+ evidence_grade: A
10
+ review_state: unreviewed
11
+ last_reviewed: 2026-08-07
12
+ ai_provenance:
13
+ model_family: GPT-5
14
+ product: Codex
15
+ generated_at: 2026-08-07
16
+ visible_context: Buildchain dev/v3/v3.0 release workflows, promotion Action, transaction and activation code, local exact-head managed-consumer callers, and the Kungfu alpha release-tail implementation.
17
+ invisible_context_boundary: Did not read credentials, private logs, signed URLs, provider state, or unpublished release assets.
18
+ ---
19
+
20
+ # Declarative release-tail contract
21
+
22
+ Buildchain v3 currently lets a consumer repository provide shell commands at
23
+ several points around publication. Those hooks made early adoption possible,
24
+ but they also let a consumer redefine the final release transaction. The
25
+ machine authority for the current inventory is
26
+ [`architecture/release-tail-contract-inventory.json`](../architecture/release-tail-contract-inventory.json).
27
+ The declaration schema is
28
+ [`contracts/release-tail-capabilities-v1.schema.json`](../contracts/release-tail-capabilities-v1.schema.json).
29
+
30
+ This contract freezes the replacement boundary. The Buildchain-owned provider
31
+ implementation is documented in
32
+ [`release-tail-provider-plane.md`](./release-tail-provider-plane.md). Adding the
33
+ provider plane does not itself cut over a consumer, run a release, or
34
+ reinterpret an already published release.
35
+
36
+ ## Current executable surfaces
37
+
38
+ The reverse scan classifies 27 workflow, Action, config, and CLI coordinates
39
+ into seven owned surface groups:
40
+
41
+ | Surface | Current role | Replacement |
42
+ | ------------------------------------------------------------------------ | --------------------------------------------------------- | ----------------------------------------------------------- |
43
+ | `publication-gate-command`, `publication-consumer-qualification-command` | Consumer-owned admission and predicate logic | Buildchain-evaluated declarative predicates |
44
+ | `publish-command`, `lifecycle.publish` | Artifact/package materialization and provider publication | `artifact.publish` |
45
+ | KFD-3, invariant Passport, and attachment commands | Product-specific evidence generation | Typed evidence requirements and Buildchain-owned projectors |
46
+ | `publication-commit-command` | Final signed or well-known channel authority move | `signed-channel.commit` |
47
+ | `release-activation-command` | Site activation and production readback | `release.activate` |
48
+ | reusable-workflow `release-passport-evidence-command` | Receipt-only released-evidence synthesis | `released-evidence.synthesize` |
49
+ | Action `verification-command` | Version-state verification before release-tail execution | Separate version-state contract; not part of release tail |
50
+
51
+ One name is already ambiguous. In the reusable promotion workflow,
52
+ `release-passport-evidence-command` means post-activation released-evidence
53
+ synthesis. In the lower-level promotion Action, the same name is a deprecated
54
+ alias for `release-passport-attachment-command`. New declarations reject that
55
+ cross-layer alias collision instead of preserving it as a permanent escape
56
+ hatch.
57
+
58
+ The current v3 managed-caller snapshot covers Buildchain self-bootstrap, both
59
+ Buildchain paper release paths, Kungfu, Libnode, KFD, and the Kungfu product
60
+ white paper. The inventory binds every snapshot to an exact commit, tree,
61
+ workflow path, runtime ref, and the executable surface groups it uses. The
62
+ legacy `agent-hub-demo@v2` caller is recorded but excluded from the v3 contract.
63
+
64
+ ## Capability declaration
65
+
66
+ A declaration contains data, never repository shell. Four capability ids cover
67
+ the current Kungfu alpha tail:
68
+
69
+ 1. `artifact.publish` publishes exact artifact roles to a declared destination.
70
+ 2. `signed-channel.commit` moves a signed channel authority only after artifact
71
+ and Passport prerequisites are durable.
72
+ 3. `release.activate` applies the production activation policy and evaluates
73
+ declared public readback predicates.
74
+ 4. `released-evidence.synthesize` consumes the validated activation receipt set
75
+ and deterministically projects released evidence.
76
+
77
+ Every capability declares:
78
+
79
+ - artifact roles and content roots;
80
+ - destination, channel/tag, activation, and readback policy;
81
+ - standardized effect, observation, and receipt schemas;
82
+ - stable transaction, subject, target, capability, and attempt identity;
83
+ - idempotency behavior and a bounded local retry class;
84
+ - exact evidence requirements.
85
+
86
+ Keys named `command`, `cmd`, `script`, `shell`, or `run` are forbidden anywhere
87
+ in the declaration. Provider adapters may translate a rooted effect into API
88
+ calls, read providers, and return observations. They may not select state
89
+ transitions, change identity, synthesize success, or execute repository-owned
90
+ shell.
91
+
92
+ The checked fixture
93
+ [`kungfu-alpha.json`](../contracts/fixtures/release-tail-capabilities-v1/kungfu-alpha.json)
94
+ represents the current Kungfu flow: public release assets, the Ed25519-signed
95
+ Alpha channel document, production status/acquisition/product readback, and
96
+ released-evidence synthesis from five canonical activation receipts.
97
+
98
+ ## One release transaction
99
+
100
+ `buildchain.release-tail/v1` is the only owner of the tail lifecycle:
101
+
102
+ ```text
103
+ prepare
104
+ -> publish artifacts
105
+ -> commit signed channel authority
106
+ -> activate
107
+ -> read back every declared predicate
108
+ -> settle receipts and released evidence
109
+ -> complete | blocked | repair-required | terminal-failure
110
+ ```
111
+
112
+ Each effect uses one stable operation identity. A duplicate attempt performs
113
+ readback before any retry. `never`, `readback`, and `provider-transient` are the
114
+ only retry classes, and no local executor may exceed three attempts. Provider
115
+ conflict, identity drift, missing readback, and exhausted retry remain explicit
116
+ terminal classifications; an adapter cannot convert them into success.
117
+
118
+ ## Compatibility and migration
119
+
120
+ The compatibility window begins when
121
+ `train/v3/v3.0/release-tail-contract` is published. It closes at the earlier of
122
+ 90 days or the first v3.2 stable release, and spans at most two minor lines.
123
+
124
+ During that window:
125
+
126
+ - previously published tags, assets, packages, signed channel documents,
127
+ Passports, and receipts remain immutable;
128
+ - only the exact enumerated callers may use the legacy adapter;
129
+ - every exception has an owner, the common expiry, and a removal test;
130
+ - migrated declarations create new transactions and never reinterpret settled
131
+ history;
132
+ - no new arbitrary command input or generic plugin is accepted.
133
+
134
+ Cutover order is the Buildchain paper callers plus a self-bootstrap no-command
135
+ regression, Kungfu's complete Alpha tail, Libnode evidence generation,
136
+ KFD/white-paper no-command regression, then deletion of the Action alias and
137
+ all remaining command inputs. This card
138
+ defines that order only; consumer migrations are separate changes.
139
+
140
+ ## Failure rules
141
+
142
+ The contract fails closed when:
143
+
144
+ - a reverse scan discovers an unregistered command-bearing release-tail input;
145
+ - one name maps to multiple capabilities;
146
+ - an effect lacks stable operation identity;
147
+ - a mutation lacks readback and receipt contracts;
148
+ - local retry is unbounded;
149
+ - an exception lacks an owner, expiry, or executable removal test.
150
+
151
+ Run the contract check with:
152
+
153
+ ```bash
154
+ node scripts/check-release-tail-contract.mjs
155
+ node --test tests/release-tail-contract.test.mjs
156
+ ```
157
+
158
+ The tests mutate the inventory and declaration fixtures to prove that orphaned
159
+ hooks, ambiguous ownership, embedded commands, missing identity/readback,
160
+ unbounded retry, and permanent escape hatches are rejected.
@@ -0,0 +1,120 @@
1
+ ---
2
+ status: draft
3
+ period: 2026-08-07
4
+ theme: buildchain-release-tail-provider-plane
5
+ doc_type: architecture
6
+ source_level: local-files
7
+ confidence: high
8
+ sensitivity: public
9
+ evidence_grade: A
10
+ review_state: unreviewed
11
+ last_reviewed: 2026-08-07
12
+ ai_provenance:
13
+ model_family: GPT-5
14
+ product: Codex
15
+ generated_at: 2026-08-07
16
+ visible_context: Buildchain release-tail declaration, provider adapters, durable transaction implementation, CLI, Action, reusable workflow, tests, and frozen consumer inventory.
17
+ invisible_context_boundary: Did not read credentials, private provider state, signed URLs, unpublished release assets, or production receipts.
18
+ ---
19
+
20
+ # Declarative release-tail provider plane
21
+
22
+ Buildchain owns the final release tail as one versioned transaction. A consumer
23
+ supplies a sealed capability declaration and data-only provider bindings; it
24
+ does not supply shell, JavaScript, executable paths, callbacks, or plugins.
25
+ The frozen boundary and migration inventory remain in
26
+ [`release-tail-contract.md`](./release-tail-contract.md).
27
+
28
+ ## Public entry points
29
+
30
+ - Node: `@kungfu-tech/buildchain/release-tail-provider-plane`,
31
+ `release-tail-provider-adapters`, `release-tail-compatibility`, and
32
+ `publication-rehearsal-runtime`.
33
+ - CLI: `buildchain release-tail plan|init|status|verify|compat|rehearse`.
34
+ - Action: `kungfu-systems/buildchain/actions/release-tail@<exact-ref>`.
35
+ - reusable workflow: `kungfu-systems/buildchain/.github/workflows/release-tail.yml@<exact-ref>`.
36
+
37
+ The CLI and Action both invoke the public publication rehearsal runtime over
38
+ the same core transaction implementation. The Action is a thin provider
39
+ transport wrapper; callers cannot inject an execution command or runner state.
40
+
41
+ ## Inputs and secrets
42
+
43
+ The declaration follows
44
+ [`release-tail-capabilities-v1.schema.json`](../contracts/release-tail-capabilities-v1.schema.json).
45
+ Provider file and endpoint bindings follow
46
+ [`release-tail-provider-bindings-v1.schema.json`](../contracts/release-tail-provider-bindings-v1.schema.json).
47
+ Bindings contain paths, asset names, HTTP methods, and evidence input paths.
48
+ GitHub and HTTP bearer tokens are separate secret inputs and never enter the
49
+ effect plan, checkpoint, observation, receipt, or output.
50
+
51
+ ## Transaction semantics
52
+
53
+ Declaration parsing rejects unknown fields, identity drift, unsupported
54
+ capability/adapter pairs, unbounded retries, and executable keys recursively.
55
+ Compilation produces deterministic effect and plan roots. Execution persists
56
+ one atomic checkpoint containing ordered operations, rooted observations, and
57
+ rooted receipts.
58
+
59
+ For each effect Buildchain performs readback before mutation, applies at most
60
+ the declared bounded local attempts, then performs readback again. Buildchain
61
+ core alone compares the declared subject and target roots and chooses
62
+ `complete`, `blocked`, `repair-required`, or `terminal-failure`. An adapter can
63
+ report observed, absent, transient, or conflict; it cannot declare success.
64
+
65
+ The built-in adapters are:
66
+
67
+ - `github-release-assets`: exact GitHub Release tag and immutable named assets;
68
+ - `signed-static-channel`: rooted HTTPS JSON channel commit with optional CAS;
69
+ - `site-release-activation`: rooted HTTPS activation and public readback;
70
+ - `activation-receipt-projector`: deterministic released-evidence synthesis.
71
+
72
+ Duplicate execution is a readback no-op. A lost mutation response is recovered
73
+ by the next local readback. A stale rooted object requires repair, immutable
74
+ provider collision is terminal, and credential/network uncertainty remains a
75
+ bounded blocked result rather than synthesized success.
76
+
77
+ ## Local verification
78
+
79
+ ```bash
80
+ buildchain release-tail plan --declaration release-tail.json
81
+ buildchain release-tail init --declaration release-tail.json --state .buildchain/release-tail/state.json
82
+ buildchain release-tail verify --state .buildchain/release-tail/state.json
83
+ ```
84
+
85
+ For complete local release semantics, use the exact capsule command in
86
+ [`publication-rehearsal.md`](publication-rehearsal.md). Simulation and replay
87
+ exercise planning, validation, transaction, retry, and evidence without
88
+ claiming external provider truth. Provider execution belongs in the Action or
89
+ reusable workflow so token handling and transport capabilities remain explicit.
90
+ Retain the state and rehearsal evidence artifacts.
91
+
92
+ ## Buildchain self-dogfood route
93
+
94
+ Buildchain self-release calls the same public reusable workflow coordinate as a
95
+ consumer:
96
+
97
+ ```text
98
+ kungfu-systems/buildchain/.github/workflows/release-candidate-promote.yml@769b221bad7a6b9104afad4c2628d9dca396ab0f
99
+ ```
100
+
101
+ The caller pins the public router and runtime to the same exact implementation
102
+ SHA. Its internal alpha shell remains on the named train, so automatic
103
+ `workflow_run` publication uses the immutable-router path without a manual
104
+ runtime override. For alpha self-release, the promotion Action materializes the
105
+ sealed GitHub Release asset declaration, executes it through this provider
106
+ plane, and retains the
107
+ declaration root, transaction root, state root, receipt roots, controller
108
+ receipt, and route-parity evidence. The legacy GitHub Release helper is not a
109
+ fallback when `declarative-release-tail` is enabled; a provider or readback
110
+ failure fails the authoritative run.
111
+
112
+ Stable routing remains on the existing `v3` shell and does not receive the new
113
+ alpha-train input. Stable cutover is a separate gate after prerelease dogfood.
114
+
115
+ ## v3 compatibility boundary
116
+
117
+ `release-tail compat --hooks-json <json-or-path>` recognizes only the frozen v3
118
+ hook names. It emits diagnostics for enumerated legacy callers and rejects any
119
+ new command-bearing release-tail field. Compatibility never converts legacy
120
+ shell into a new provider plugin and never reinterprets settled release history.
@@ -683,6 +683,17 @@ For a declared macOS `archive`, the authority safely extracts the sealed
683
683
  container, signs and verifies every Mach-O payload, signs Mach-O payloads inside
684
684
  embedded Python wheels, rebuilds each affected wheel's PEP 427 `RECORD`, and
685
685
  recreates the original zip or tar.gz before returning the exact final bytes.
686
+ Archives whose executable hosts a JIT runtime can additionally request the
687
+ Buildchain-owned `entitlements_profile = "jit-executable-v1"` and exact paths,
688
+ for example `entitlements_paths = ["product/runtime/python/bin/python3"]`.
689
+ Paths are relative to the extracted archive root. The authority
690
+ then attaches only `com.apple.security.cs.allow-jit` to the exact executable
691
+ Mach-O files sealed in `entitlements_paths`, leaves every other executable and
692
+ library without exception entitlements, and records the profile, paths, and
693
+ entitled executable count in provider evidence. Consumer-provided entitlement
694
+ files and wildcard target paths are unsupported. The profile is valid only for
695
+ Apple `archive` requests and fails closed on an unsafe, missing,
696
+ non-executable, duplicate, or unsealed target path.
686
697
  Windows `pe` and `binary` artifacts
687
698
  resolve to timestamped native `windows-authenticode`; Windows PE never falls
688
699
  back to a detached signature. Linux and other non-native binary files,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kungfu-tech/buildchain",
3
- "version": "3.0.6",
3
+ "version": "3.0.7-alpha.1",
4
4
  "private": false,
5
5
  "description": "Buildchain Release Passport, release governance, CLI toolkit, and site facts.",
6
6
  "repository": "https://github.com/kungfu-systems/buildchain",
@@ -49,6 +49,8 @@
49
49
  "./publication-control-plane-audit": "./packages/core/publication-control-plane-audit.js",
50
50
  "./buildchain-publication-authority": "./packages/core/buildchain-publication-authority.js",
51
51
  "./github-governance-authority": "./packages/core/github-governance-authority.js",
52
+ "./engineering-housekeeper": "./packages/core/engineering-housekeeper.js",
53
+ "./engineering-housekeeper-github": "./packages/core/engineering-housekeeper-github.js",
52
54
  "./kfd-gate": "./packages/core/kfd-gate.js",
53
55
  "./release-candidate": "./packages/core/release-candidate.js",
54
56
  "./release-candidate-recovery": "./packages/core/release-candidate-recovery.js",
@@ -57,6 +59,11 @@
57
59
  "./release-passport-contract": "./packages/core/release-passport-contract.js",
58
60
  "./release-propagation": "./packages/core/release-propagation.js",
59
61
  "./release-activation-transaction": "./packages/core/release-activation-transaction.js",
62
+ "./release-tail-provider-plane": "./packages/core/release-tail-provider-plane.js",
63
+ "./release-tail-provider-adapters": "./packages/core/release-tail-provider-adapters.js",
64
+ "./release-tail-compatibility": "./packages/core/release-tail-compatibility.js",
65
+ "./publication-rehearsal-runtime": "./packages/core/publication-rehearsal-runtime.js",
66
+ "./publication-rehearsal-projection": "./packages/core/publication-rehearsal-projection.js",
60
67
  "./surface-manifest": "./packages/core/surface-manifest.js",
61
68
  "./buildchain-kfd-claims": "./packages/core/buildchain-kfd-claims.js",
62
69
  "./site/buildchain-site.json": "./dist/site/buildchain-site.json",
@@ -111,8 +118,8 @@
111
118
  "packageManager": "pnpm@11.7.0",
112
119
  "scripts": {
113
120
  "operator:windows-jit": "bash scripts/aws-windows-jit-operator.sh",
114
- "check": "pnpm run check:static && node scripts/check-maintainability.mjs && node scripts/check-internal-architecture.mjs && node scripts/check-inventory.mjs && pnpm run check:site && pnpm run check:workflows && pnpm run test:unit && pnpm run check:golden-path && node scripts/check-action-bundles.mjs",
115
- "check:static": "node scripts/check-javascript-syntax.mjs && prettier --check architecture/*.json bin/internal/command-registry.mjs scripts/authorize-promotion-runtime-override.cjs scripts/check-javascript-syntax.mjs scripts/check-maintainability.mjs scripts/maintainability-metrics.mjs scripts/public-reference.mjs scripts/site-reference-registry.mjs scripts/generate-public-reference.mjs scripts/verify-golden-path.mjs tests/authorize-promotion-runtime-override.test.mjs tests/command-registry.test.mjs tests/maintainability.test.mjs tests/promotion-responsibilities.test.mjs tests/public-reference.test.mjs",
121
+ "check": "pnpm run check:static && node scripts/check-maintainability.mjs && node scripts/check-internal-architecture.mjs && node scripts/check-inventory.mjs && node scripts/check-core-mechanism-inventory.mjs && node scripts/check-release-tail-contract.mjs && node scripts/v4-architecture.mjs validate && pnpm run check:site && pnpm run check:workflows && pnpm run test:unit && pnpm run check:golden-path && node scripts/check-action-bundles.mjs",
122
+ "check:static": "node scripts/check-javascript-syntax.mjs && prettier --check architecture/*.json contracts/release-tail-capabilities-v1.schema.json contracts/release-tail-provider-bindings-v1.schema.json contracts/publication-rehearsal-capsule-v1.schema.json contracts/fixtures/release-tail-capabilities-v1/*.json bin/internal/command-registry.mjs scripts/authorize-promotion-runtime-override.cjs scripts/check-core-mechanism-inventory.mjs scripts/check-release-tail-contract.mjs scripts/check-javascript-syntax.mjs scripts/check-maintainability.mjs scripts/maintainability-metrics.mjs scripts/public-reference.mjs scripts/site-reference-registry.mjs scripts/generate-public-reference.mjs scripts/v4-architecture.mjs scripts/verify-golden-path.mjs tests/authorize-promotion-runtime-override.test.mjs tests/command-registry.test.mjs tests/core-mechanism-inventory.test.mjs tests/release-tail-contract.test.mjs tests/maintainability.test.mjs tests/promotion-responsibilities.test.mjs tests/public-reference.test.mjs tests/v4-architecture.test.mjs",
116
123
  "check:workflows": "bash scripts/check-workflows.sh",
117
124
  "generate:reference": "node scripts/generate-public-reference.mjs",
118
125
  "check:reference": "node scripts/generate-public-reference.mjs --check",
@@ -132,6 +139,7 @@
132
139
  },
133
140
  "dependencies": {
134
141
  "@kungfu-tech/kfd": "1.0.0-alpha.53",
142
+ "ajv": "8.20.0",
135
143
  "smol-toml": "1.7.0"
136
144
  }
137
145
  }
@@ -9,6 +9,7 @@ export const ARTIFACT_SIGNING_AUTHORITY_CONTRACT =
9
9
 
10
10
  const SHA256_PATTERN = /^sha256:[0-9a-f]{64}$/u;
11
11
  const SOURCE_SHA_PATTERN = /^[0-9a-f]{40}$/u;
12
+ const ENTITLEMENTS_PROFILES = new Set(["none", "jit-executable-v1"]);
12
13
  const FORBIDDEN_CREDENTIAL_KEYS =
13
14
  /(?:certificate|password|private.?key|secret|token|notary|issuer|team.?id|environment)/iu;
14
15
 
@@ -88,6 +89,64 @@ function exactSourceSha(value, label) {
88
89
  return normalized;
89
90
  }
90
91
 
92
+ function entitlementsPaths(value) {
93
+ if (value === undefined) return [];
94
+ if (!Array.isArray(value)) {
95
+ throw new Error("signing entitlements paths must be an array");
96
+ }
97
+ const paths = value.map((entry, index) => {
98
+ const normalized = nonEmptyString(
99
+ entry,
100
+ `signing entitlements paths[${index}]`,
101
+ );
102
+ const parts = normalized.split("/");
103
+ if (
104
+ normalized.startsWith("/") ||
105
+ normalized.includes("\\") ||
106
+ normalized.includes(",") ||
107
+ parts.some((part) => part === "" || part === "." || part === "..")
108
+ ) {
109
+ throw new Error(
110
+ `signing entitlements paths[${index}] must be a safe archive-relative path`,
111
+ );
112
+ }
113
+ return normalized;
114
+ });
115
+ if (new Set(paths).size !== paths.length) {
116
+ throw new Error("signing entitlements paths must not contain duplicates");
117
+ }
118
+ return paths;
119
+ }
120
+
121
+ function signingEntitlements(profileId, kind, signature) {
122
+ const profile = String(signature.entitlementsProfile || "none").trim();
123
+ const paths = entitlementsPaths(signature.entitlementsPaths);
124
+ if (!ENTITLEMENTS_PROFILES.has(profile)) {
125
+ throw new Error(
126
+ `unsupported signing entitlements profile: ${profile || "<empty>"}`,
127
+ );
128
+ }
129
+ if (
130
+ profile !== "none" &&
131
+ (profileId !== "apple-developer-id" || kind !== "archive")
132
+ ) {
133
+ throw new Error(
134
+ `signing entitlements profile ${profile} requires an Apple archive`,
135
+ );
136
+ }
137
+ if (
138
+ (profile === "none" && paths.length !== 0) ||
139
+ (profile !== "none" && paths.length === 0)
140
+ ) {
141
+ throw new Error(
142
+ "signing entitlements paths must be non-empty exactly when an entitlements profile is enabled",
143
+ );
144
+ }
145
+ return profile === "none"
146
+ ? {}
147
+ : { entitlementsProfile: profile, entitlementsPaths: paths };
148
+ }
149
+
91
150
  function assertNoCredentialMaterial(value, path = "request") {
92
151
  if (!value || typeof value !== "object") return;
93
152
  for (const [key, child] of Object.entries(value)) {
@@ -191,6 +250,7 @@ export function createArtifactSigningRequest({
191
250
  platform,
192
251
  artifactKind: kind,
193
252
  });
253
+ const entitlementIntent = signingEntitlements(profile.id, kind, signature);
194
254
  const request = {
195
255
  schemaVersion: 1,
196
256
  contract: ARTIFACT_SIGNING_REQUEST_CONTRACT,
@@ -253,6 +313,7 @@ export function createArtifactSigningRequest({
253
313
  profile: profile.id,
254
314
  provider: profile.provider,
255
315
  semantics: profile.semantics,
316
+ ...entitlementIntent,
256
317
  },
257
318
  delivery: {
258
319
  mode: nonEmptyString(
@@ -29,6 +29,9 @@ export const BUILDCHAIN_AGENT_MANUALS = Object.freeze([
29
29
  { id: "lifecycle-protocol", title: "Lifecycle protocol", path: "docs/lifecycle-protocol.md", plane: "use" },
30
30
  { id: "reusable-build-surface", title: "Reusable build surface", path: "docs/reusable-build-surface.md", plane: "use" },
31
31
  { id: "publish-transaction", title: "Publish transaction", path: "docs/publish-transaction.md", plane: "verify" },
32
+ { id: "release-tail-contract", title: "Declarative release-tail contract", path: "docs/release-tail-contract.md", plane: "verify" },
33
+ { id: "release-tail-provider-plane", title: "Declarative release-tail provider plane", path: "docs/release-tail-provider-plane.md", plane: "use" },
34
+ { id: "publication-rehearsal", title: "Publication rehearsal", path: "docs/publication-rehearsal.md", plane: "use" },
32
35
  { id: "release-governance", title: "Release governance", path: "docs/release-governance.md", plane: "why" },
33
36
  { id: "release-flow", title: "Release flow", path: "docs/release-flow.md", plane: "verify" },
34
37
  { id: "runtime-train-validation", title: "Runtime train validation", path: "docs/runtime-train-validation.md", plane: "verify" },