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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/README.md +4 -2
  2. package/actions/release-tail/README.md +17 -0
  3. package/bin/buildchain.mjs +11 -0
  4. package/bin/internal/command-registry.mjs +2 -0
  5. package/contracts/fixtures/release-tail-capabilities-v1/kungfu-alpha.json +273 -0
  6. package/contracts/publication-rehearsal-capsule-v1.schema.json +173 -0
  7. package/contracts/release-tail-capabilities-v1.schema.json +199 -0
  8. package/contracts/release-tail-provider-bindings-v1.schema.json +56 -0
  9. package/dist/site/agent-index.json +3 -0
  10. package/dist/site/artifact-schemas.json +6 -0
  11. package/dist/site/buildchain-contract.json +35 -20
  12. package/dist/site/buildchain-site.json +307 -17
  13. package/dist/site/capability-registry.json +12 -9
  14. package/dist/site/cli-registry.json +102 -0
  15. package/dist/site/controller-registry.json +14 -2
  16. package/dist/site/kfd-claims.json +247 -16
  17. package/dist/site/kfd-upstream-aggregate.json +1 -1
  18. package/dist/site/manual-registry.json +48 -3
  19. package/dist/site/node-api-registry.json +3108 -1409
  20. package/dist/site/page-registry.json +275 -9
  21. package/dist/site/public-surface-audit.json +304 -15
  22. package/dist/site/publication-authority-registry.json +26 -1
  23. package/dist/site/publication-registry.json +4 -4
  24. package/dist/site/release-provenance.json +5 -0
  25. package/dist/site/schemas/publication-rehearsal-capsule-v1.schema.json +269 -0
  26. package/dist/site/schemas/release-tail-capabilities-v1.schema.json +353 -0
  27. package/dist/site/schemas/release-tail-provider-bindings-v1.schema.json +94 -0
  28. package/dist/site/site-manifest.json +31 -7
  29. package/dist/site/workflow-registry.json +86 -9
  30. package/docs/MAP.md +5 -2
  31. package/docs/cli-reference.md +136 -0
  32. package/docs/node-api-reference.md +233 -84
  33. package/docs/publication-rehearsal.md +94 -0
  34. package/docs/release-tail-contract.md +160 -0
  35. package/docs/release-tail-provider-plane.md +120 -0
  36. package/package.json +8 -3
  37. package/packages/core/buildchain-agent-manuals.js +3 -0
  38. package/packages/core/buildchain-kfd-claims.js +1 -1
  39. package/packages/core/buildchain-publication-authority.js +1 -0
  40. package/packages/core/index.js +39 -0
  41. package/packages/core/paper-agent-entry.js +11 -5
  42. package/packages/core/paper-repository.js +1 -0
  43. package/packages/core/paper-scaffold-content.js +21 -0
  44. package/packages/core/paper.js +28 -2
  45. package/packages/core/publication-rehearsal-projection.js +173 -0
  46. package/packages/core/publication-rehearsal-runtime.js +909 -0
  47. package/packages/core/release-tail-compatibility.js +60 -0
  48. package/packages/core/release-tail-provider-adapters.js +461 -0
  49. package/packages/core/release-tail-provider-plane.js +1228 -0
  50. package/scripts/assemble-publication-artifact-admission.mjs +1 -1
  51. package/scripts/assemble-self-publication-admission.mjs +1 -1
  52. package/scripts/buildchain-cli-help.mjs +13 -0
  53. package/scripts/check-core-mechanism-inventory.mjs +347 -0
  54. package/scripts/check-inventory.mjs +8 -8
  55. package/scripts/check-maintainability.mjs +9 -2
  56. package/scripts/check-release-tail-contract.mjs +435 -0
  57. package/scripts/generate-channel-promotion-workflow.mjs +10 -8
  58. package/scripts/generate-site-bundle.mjs +24 -0
  59. package/scripts/init-repo.mjs +26 -2
  60. package/scripts/materialize-self-release-candidate-version.mjs +131 -0
  61. package/scripts/release-tail.mjs +159 -0
  62. package/scripts/site-capability-metadata.mjs +11 -0
  63. package/scripts/v4-architecture.mjs +600 -0
  64. 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.
@@ -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@9a0cdf8d84aacf8c7daaac82efa43d1b34696a03
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.
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.0",
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",
@@ -57,6 +57,11 @@
57
57
  "./release-passport-contract": "./packages/core/release-passport-contract.js",
58
58
  "./release-propagation": "./packages/core/release-propagation.js",
59
59
  "./release-activation-transaction": "./packages/core/release-activation-transaction.js",
60
+ "./release-tail-provider-plane": "./packages/core/release-tail-provider-plane.js",
61
+ "./release-tail-provider-adapters": "./packages/core/release-tail-provider-adapters.js",
62
+ "./release-tail-compatibility": "./packages/core/release-tail-compatibility.js",
63
+ "./publication-rehearsal-runtime": "./packages/core/publication-rehearsal-runtime.js",
64
+ "./publication-rehearsal-projection": "./packages/core/publication-rehearsal-projection.js",
60
65
  "./surface-manifest": "./packages/core/surface-manifest.js",
61
66
  "./buildchain-kfd-claims": "./packages/core/buildchain-kfd-claims.js",
62
67
  "./site/buildchain-site.json": "./dist/site/buildchain-site.json",
@@ -111,8 +116,8 @@
111
116
  "packageManager": "pnpm@11.7.0",
112
117
  "scripts": {
113
118
  "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",
119
+ "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",
120
+ "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
121
  "check:workflows": "bash scripts/check-workflows.sh",
117
122
  "generate:reference": "node scripts/generate-public-reference.mjs",
118
123
  "check:reference": "node scripts/generate-public-reference.mjs --check",
@@ -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" },
@@ -138,7 +138,7 @@ function immediateReadmes(root, dir) {
138
138
 
139
139
  function publicDocumentationFiles(root) {
140
140
  return uniquePaths([
141
- ...BUILDCHAIN_AGENT_MANUALS.map((entry) => entry.path),
141
+ ...(readJson(root, "dist/site/manual-registry.json").manuals || BUILDCHAIN_AGENT_MANUALS).map((entry) => entry.path),
142
142
  "README.md",
143
143
  "packages/core/README.md",
144
144
  ...immediateReadmes(root, "actions"),
@@ -50,6 +50,7 @@ const DESCRIPTORS = Object.freeze([
50
50
  [".github/workflows/release-candidate-promote.yml", "product-publication", true, ["npm-publish", "github-release", "channel-ref"], "trusted-publishing", "none", "fixed", "caller-bound"],
51
51
  [".github/workflows/release-line-bootstrap.yml", "governance-write"],
52
52
  [".github/workflows/release-propagation.yml", "governance-write"],
53
+ [".github/workflows/release-tail.yml", "product-publication", true, ["artifact.publish", "signed-channel.commit", "release.activate", "released-evidence.synthesize"], "caller-secrets", "caller-bound", "caller-bound", "fixed"],
53
54
  [".github/workflows/release-verify.yml", "governance-write"],
54
55
  [".github/workflows/stable-candidate-patrol.yml", "governance-write"],
55
56
  ]);
@@ -58,6 +58,45 @@ export {
58
58
  writeReleaseTransaction,
59
59
  } from "./publish-transaction.js";
60
60
 
61
+ export {
62
+ RELEASE_TAIL_CAPABILITY_REGISTRY,
63
+ RELEASE_TAIL_DECLARATION_CONTRACT,
64
+ RELEASE_TAIL_EFFECT_SCHEMA,
65
+ RELEASE_TAIL_OBSERVATION_SCHEMA,
66
+ RELEASE_TAIL_RECEIPT_SCHEMA,
67
+ RELEASE_TAIL_STATES,
68
+ RELEASE_TAIL_TRANSACTION_POLICY,
69
+ RELEASE_TAIL_TRANSACTION_SCHEMA,
70
+ compileReleaseTailDeclaration,
71
+ createReleaseTailAdapterSet,
72
+ createReleaseTailTransaction,
73
+ executeReleaseTailTransaction,
74
+ parseReleaseTailDeclaration,
75
+ readReleaseTailTransaction,
76
+ releaseTailRetryPolicyFromDeclaration,
77
+ releaseTailRoot,
78
+ releaseTailStableJson,
79
+ validateReleaseTailEffectPlan,
80
+ validateReleaseTailTransaction,
81
+ writeReleaseTailTransaction,
82
+ } from "./release-tail-provider-plane.js";
83
+
84
+ export {
85
+ ReleaseTailProviderError,
86
+ createActivationReceiptProjectorAdapter,
87
+ createGitHubReleaseAssetsAdapter,
88
+ createHttpJsonReadback,
89
+ createSignedStaticChannelAdapter,
90
+ createSiteReleaseActivationAdapter,
91
+ githubReleaseAssetsTargetRoot,
92
+ } from "./release-tail-provider-adapters.js";
93
+
94
+ export {
95
+ RELEASE_TAIL_COMPATIBILITY_CONTRACT,
96
+ RELEASE_TAIL_LEGACY_HOOKS,
97
+ diagnoseLegacyReleaseTailHooks,
98
+ } from "./release-tail-compatibility.js";
99
+
61
100
  export {
62
101
  createPortableDevCachePlan,
63
102
  createPortableDevCacheReceipt,
@@ -12,6 +12,7 @@ import {
12
12
  stableJson,
13
13
  workCheck,
14
14
  } from "./paper-repository.js";
15
+ import { mergePublicationRehearsalAgentInstructions } from "./publication-rehearsal-projection.js";
15
16
 
16
17
  export const PAPER_AGENT_ENTRY_CONTRACT = "kungfu-buildchain-paper-agent-entry";
17
18
  export const PAPER_AGENT_ENTRY_SCHEMA_VERSION = 1;
@@ -167,9 +168,11 @@ export function paperAgentEntryFiles({
167
168
  [PAPER_PATHS.agentEntry, jsonText(entry)],
168
169
  [
169
170
  PAPER_PATHS.agentInstructions,
170
- mergePaperAgentEntryInstructions(currentAgents, {
171
- developmentRef: resolvedDevelopmentRef,
172
- }),
171
+ mergePublicationRehearsalAgentInstructions(
172
+ mergePaperAgentEntryInstructions(currentAgents, {
173
+ developmentRef: resolvedDevelopmentRef,
174
+ }),
175
+ ),
173
176
  ],
174
177
  ]);
175
178
  }
@@ -205,8 +208,11 @@ function ciContext({ env, developmentRef }) {
205
208
  sourceBranch.startsWith(versionStatePrefix) &&
206
209
  /^[0-9a-f]{12}$/i.test(sourceBranch.slice(versionStatePrefix.length));
207
210
  const branchOk = pullRequest
208
- ? (PAPER_WORK_BRANCH_PATTERN.test(sourceBranch) && targetBranch === developmentRef) ||
209
- (channelIndex > 0 && sourceBranch === channelBranches[channelIndex - 1]) || generatedVersionState
211
+ ? (PAPER_WORK_BRANCH_PATTERN.test(sourceBranch) &&
212
+ targetBranch === developmentRef) ||
213
+ (channelIndex > 0 &&
214
+ sourceBranch === channelBranches[channelIndex - 1]) ||
215
+ generatedVersionState
210
216
  : channelBranches.includes(refName);
211
217
  return {
212
218
  mode: "ci",
@@ -13,6 +13,7 @@ export const PAPER_PATHS = Object.freeze({
13
13
  buildWorkflow: ".github/workflows/build.yml",
14
14
  verifyWorkflow: ".github/workflows/verify.yml",
15
15
  releaseWorkflow: ".github/workflows/paper-release.yml",
16
+ rehearsalWorkflow: ".github/workflows/publication-rehearsal.yml",
16
17
  pnpmWorkspace: "pnpm-workspace.yaml",
17
18
  reproducibilityReceipt:
18
19
  ".buildchain/publication/reproducibility-receipt.json",
@@ -1,3 +1,10 @@
1
+ import {
2
+ PUBLICATION_REHEARSAL_CAPSULE_CONTRACT,
3
+ PUBLICATION_REHEARSAL_COMMAND,
4
+ RELEASE_LOCAL_CONSTRUCTIBILITY_ADR,
5
+ RELEASE_LOCAL_CONSTRUCTIBILITY_INVARIANT,
6
+ } from "./publication-rehearsal-runtime.js";
7
+
1
8
  function jsonText(value) {
2
9
  return `${JSON.stringify(value, null, 2)}\n`;
3
10
  }
@@ -47,6 +54,7 @@ export function paperPackageScripts(current = {}) {
47
54
  "paper:work:start": "buildchain paper work start",
48
55
  "paper:work:submit": "buildchain paper work submit",
49
56
  "paper:status": "buildchain paper status --json",
57
+ "publication:rehearse": PUBLICATION_REHEARSAL_COMMAND,
50
58
  };
51
59
  }
52
60
 
@@ -106,6 +114,7 @@ pnpm paper:preflight
106
114
  pnpm paper:agent:verify
107
115
  pnpm paper:work:start -- <topic>
108
116
  pnpm paper:work:submit
117
+ pnpm publication:rehearse
109
118
  make pdf
110
119
  \`\`\`
111
120
 
@@ -114,6 +123,11 @@ artifact generation, sealed publication, npm Trusted Publishing, and recovery;
114
123
  this repository owns the paper source and review history.
115
124
 
116
125
  See [docs/MAP.md](docs/MAP.md) for the repository map.
126
+
127
+ Publication qualification follows the Buildchain
128
+ \`${RELEASE_LOCAL_CONSTRUCTIBILITY_ADR}\` invariant:
129
+ ${RELEASE_LOCAL_CONSTRUCTIBILITY_INVARIANT} The capsule contract is
130
+ \`${PUBLICATION_REHEARSAL_CAPSULE_CONTRACT}\`.
117
131
  `;
118
132
  }
119
133
 
@@ -129,10 +143,17 @@ export function scaffoldMap() {
129
143
  - \`.github/workflows/build.yml\`: thin read-only build and reproducibility caller.
130
144
  - \`.github/workflows/verify.yml\`: thin required check that enforces the Paper entry and acceptance policy.
131
145
  - \`.github/workflows/paper-release.yml\`: thin protected sealed-release caller.
146
+ - \`.github/workflows/publication-rehearsal.yml\`: thin hosted adapter over the same local capsule runtime.
132
147
 
133
148
  The repository does not own npm transaction logic, publication authority,
134
149
  release-state recovery, or site deployment mechanics. Those remain Buildchain,
135
150
  npm/GitHub, and downstream site responsibilities respectively.
151
+
152
+ The exact local pre-publication command is:
153
+
154
+ \`\`\`sh
155
+ ${PUBLICATION_REHEARSAL_COMMAND}
156
+ \`\`\`
136
157
  `;
137
158
  }
138
159