@kungfu-tech/buildchain 4.1.3 → 4.1.4-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.
- package/AGENTS.md +11 -13
- package/CONTRIBUTING.md +32 -9
- package/README.md +56 -140
- package/actions/release/promotion/ref/README.md +1 -1
- package/architecture/action-taxonomy.json +1 -1
- package/architecture/agent-change-map.md +32 -45
- package/architecture/build-orchestration.json +1 -1
- package/architecture/capability-state-machine-manifest.json +5 -5
- package/architecture/ci-lane-change-budget.json +92 -92
- package/architecture/code-layout.json +2 -12
- package/architecture/core-mechanisms.json +38 -39
- package/architecture/cross-platform-adopter-qualification.json +1 -1
- package/architecture/dev-delivery-orchestration.json +2 -2
- package/architecture/floating-consumer-policy.json +3 -3
- package/architecture/internal-capabilities.json +27 -28
- package/architecture/maintainability-debt.json +60 -94
- package/architecture/maintainability-policy.json +7 -13
- package/architecture/minimal-consumer-migration.json +43 -5014
- package/architecture/platform-stage-checkpoints.json +1 -1
- package/architecture/release-tail-contract.json +2 -2
- package/architecture/release-topology.json +31 -25
- package/architecture/stage-capsule-qualification.json +1 -1
- package/architecture/universal-workflow-bootstrap.json +60 -60
- package/architecture/universal-workflow-capability-policy.json +3 -3
- package/architecture/universal-workflow-fault-campaign.json +7 -7
- package/architecture/workflow-taxonomy.json +59 -60
- package/contracts/fixtures/v4-tail-reseal-v1/valid.json +1 -1
- package/dist/site/buildchain-contract.json +138 -66
- package/dist/site/buildchain-site.json +257 -331
- package/dist/site/capability-registry.json +4 -4
- package/dist/site/cli-registry.json +6 -142
- package/dist/site/controller-registry.json +19 -19
- package/dist/site/kfd-claims.json +481 -529
- package/dist/site/kfd-upstream-aggregate.json +1 -1
- package/dist/site/manual-registry.json +22 -22
- package/dist/site/node-api-registry.json +82 -339
- package/dist/site/page-registry.json +229 -304
- package/dist/site/public-surface-audit.json +544 -754
- package/dist/site/publication-authority-registry.json +316 -316
- package/dist/site/publication-registry.json +1 -1
- package/dist/site/site-manifest.json +23 -23
- package/dist/site/workflow-registry.json +1071 -1027
- package/docs/MAP.md +28 -20
- package/docs/auditable-demo.md +17 -49
- package/docs/bootstrap-recovery.md +46 -37
- package/docs/cli-reference.md +2 -46
- package/docs/cli.md +97 -186
- package/docs/code-organization.md +7 -5
- package/docs/dev-alpha-candidate-patrol.md +19 -42
- package/docs/dev-delivery-orchestration.md +15 -11
- package/docs/dev-delivery-qualification-landing-adr.md +10 -9
- package/docs/dev-delivery-warrant.md +17 -16
- package/docs/dev-qualification-patrol.md +25 -20
- package/docs/getting-started.md +80 -139
- package/docs/github-artifact-attestation.md +31 -81
- package/docs/install.md +66 -30
- package/docs/lifecycle-protocol.md +19 -57
- package/docs/migration-inventory.md +17 -45
- package/docs/next-development-transition.md +13 -13
- package/docs/node-api-reference.md +122 -138
- package/docs/oci-publication.md +13 -10
- package/docs/publication-artifacts.md +128 -486
- package/docs/publication-authority.md +15 -45
- package/docs/publish-transaction.md +13 -11
- package/docs/release-candidate.md +126 -355
- package/docs/release-discussions.md +36 -67
- package/docs/release-flow.md +80 -339
- package/docs/release-governance.md +114 -962
- package/docs/release-promotion-request.md +45 -43
- package/docs/release-propagation.md +13 -27
- package/docs/release-tail-provider-plane.md +38 -65
- package/docs/reusable-build-surface.md +78 -196
- package/docs/runtime-train-validation.md +8 -6
- package/docs/stable-candidate-patrol.md +13 -66
- package/docs/v4-adopter-delivery.md +15 -15
- package/docs/v4-declarative-release-tail-migration.md +19 -17
- package/docs/v4-production-release.md +11 -6
- package/docs/v4-publication-rehearsal.md +12 -27
- package/docs/v4-stage-capsule.md +14 -20
- package/docs/v4-tail-reseal.md +34 -20
- package/docs/web-surface-deployments.md +26 -264
- package/docs/workflow-catalog.md +31 -31
- package/docs/workflow-path-migration.md +10 -4
- package/package.json +5 -4
- package/packages/core/adoption/buildchain-kfd-claims.js +7 -7
- package/packages/core/adoption/cli/output.mjs +1 -9
- package/packages/core/adoption/cli/product-gate.mjs +1 -15
- package/packages/core/adoption/cli/project.mjs +9 -10
- package/packages/core/adoption/cli/standards.mjs +1 -14
- package/packages/core/adoption/cli/support.mjs +0 -2
- package/packages/core/adoption/cli/surface-register.mjs +0 -2
- package/packages/core/adoption/commands/init-repo.mjs +77 -485
- package/packages/core/adoption/consumer-init.js +279 -0
- package/packages/core/adoption/qualification/admission.js +1 -1
- package/packages/core/build/cli/cache.mjs +0 -2
- package/packages/core/build/cli/facts.mjs +0 -3
- package/packages/core/build/cli/homebrew.mjs +0 -4
- package/packages/core/build/cli/lifecycle.mjs +0 -3
- package/packages/core/build/github-artifact-attestation.js +2 -2
- package/packages/core/build/platform-stage-checkpoints.js +1 -1
- package/packages/core/build/signing/dispatch.js +1 -1
- package/packages/core/consumer/buildchain-config.js +9 -0
- package/packages/core/consumer/contract/inspection.js +351 -9
- package/packages/core/consumer/contract/javascript-syntax.js +439 -0
- package/packages/core/consumer/contract/javascript-values.js +61 -0
- package/packages/core/consumer/contract/javascript.js +555 -0
- package/packages/core/consumer/contract/local-validation.js +84 -0
- package/packages/core/contracts/buildchain-contract.js +39 -8
- package/packages/core/contracts/cli/introspection.mjs +1 -9
- package/packages/core/contracts/public-surface-cli.js +0 -1
- package/packages/core/dev-delivery/dev-delivery-contract-surface.js +2 -2
- package/packages/core/governance/buildchain-publication-authority.js +24 -24
- package/packages/core/governance/cli/doctor.mjs +58 -42
- package/packages/core/governance/commands/architecture.mjs +6 -1
- package/packages/core/governance/commands/audit-publication-control-plane.mjs +1 -1
- package/packages/core/governance/commands/workflow-friction-report.mjs +1 -1
- package/packages/core/governance/github-governance-authority.js +2 -2
- package/packages/core/governance/publication/collection.js +1 -1
- package/packages/core/index.js +1 -3
- package/packages/core/observability/cli/candidate.mjs +0 -2
- package/packages/core/observability/cli/context.mjs +0 -5
- package/packages/core/observability/cli/diagnostics.mjs +0 -7
- package/packages/core/observability/cli/events.mjs +2 -10
- package/packages/core/paper/commands/paper-work-fleet-cli.mjs +1 -1
- package/packages/core/paper/commands/paper.mjs +33 -422
- package/packages/core/paper/consumer-status.js +72 -0
- package/packages/core/paper/operations/identity.js +0 -3
- package/packages/core/paper/operations/migration.js +460 -0
- package/packages/core/paper/operations/preflight-checks.js +8 -68
- package/packages/core/paper/operations/scaffold.js +16 -326
- package/packages/core/paper/operations/status.js +27 -53
- package/packages/core/paper/paper-agent-entry.js +36 -147
- package/packages/core/paper/paper-fleet.js +24 -39
- package/packages/core/paper/paper-repository.js +16 -0
- package/packages/core/paper/paper-runtime-channels.js +1 -1
- package/packages/core/paper/paper-scaffold-content.js +153 -162
- package/packages/core/paper/paper-work.js +3 -10
- package/packages/core/paper/paper.js +43 -5
- package/packages/core/providers/github/artifact-attestation.js +1 -1
- package/packages/core/providers/github/pipeline-context-artifacts.js +172 -0
- package/packages/core/publication/authority/control-plane.js +2 -2
- package/packages/core/publication/authority/seal.js +1 -1
- package/packages/core/publication/cli/dispatch.mjs +1 -12
- package/packages/core/publication/pipeline/actions.js +16 -9
- package/packages/core/publication/pipeline/apply.js +17 -9
- package/packages/core/publication/pipeline/context.js +29 -0
- package/packages/core/publication/pipeline/prepare.js +15 -6
- package/packages/core/publication/pipeline/recovery-materials.js +63 -1
- package/packages/core/publication/pipeline/recovery-prepare.js +21 -9
- package/packages/core/publication/pipeline/stable-entry.js +12 -7
- package/packages/core/publication/pipeline/stable-products.js +21 -19
- package/packages/core/publication/pipeline/version-actions.js +15 -6
- package/packages/core/publication/publication-rehearsal-projection.js +0 -9
- package/packages/core/release/cli/dispatch.mjs +1 -4
- package/packages/core/release/cli/inspection-handlers.mjs +1 -33
- package/packages/core/release/cli/release-handlers.mjs +2 -19
- package/packages/core/release/cli/verification-handlers.mjs +4 -25
- package/packages/core/release/next-development-projection.js +13 -13
- package/packages/core/release/passport/locations.js +13 -8
- package/packages/core/release/release-passport.js +70 -5
- package/packages/core/web/cli/badges.mjs +0 -4
- package/packages/core/web/publication-admission.js +1 -1
- package/packages/core/web/publication-capability.js +1 -1
- package/packages/core/web/readme-badges.js +1 -1
- package/packages/core/workflow/cli/main.mjs +1 -4
- package/packages/core/workflow/cli/process.mjs +1 -1
- package/packages/core/workflow/commands/buildchain-cli-help.mjs +2 -8
- package/packages/core/workflow/engine/conformance.js +1 -1
- package/packages/core/workflow/pipeline/build.js +21 -1
- package/packages/core/workflow/pipeline/delivery-observation.js +6 -2
- package/packages/core/workflow/workflow-taxonomy.mjs +61 -17
- package/scripts/check-code-layout.mjs +2 -0
- package/scripts/check-core-mechanism-inventory.mjs +29 -13
- package/scripts/check-floating-consumer-policy-contract.mjs +3 -3
- package/scripts/check-inventory.mjs +27 -27
- package/scripts/check-maintainability.mjs +28 -5
- package/scripts/check-public-dogfood-contract.mjs +3 -3
- package/scripts/check-release-topology.mjs +1 -1
- package/scripts/check-self-consumer-contract.mjs +7 -7
- package/scripts/check-universal-workflow-bootstrap.mjs +1 -1
- package/scripts/generate-channel-promotion-workflow.mjs +1 -1
- package/scripts/generate-minimal-consumer-contract.mjs +21 -1
- package/scripts/generate-site-bundle.mjs +2 -1
- package/scripts/generate-tail-reseal-fixture.mjs +3 -3
- package/scripts/inventory/promotion.mjs +1 -1
- package/scripts/next-development-self-dogfood-harness.mjs +1 -1
- package/scripts/next-development-self-dogfood.mjs +4 -4
- package/scripts/site-capability-metadata.mjs +2 -6
- package/scripts/source-metric-lineage.mjs +62 -7
- package/scripts/verify-golden-path.mjs +31 -35
- package/templates/native-dev-delivery.yml +1 -1
- package/templates/universal-buildchain-bootstrap.yml +1 -1
- package/packages/core/paper/operations/bootstrap.js +0 -75
- package/packages/core/paper/operations/plans.js +0 -213
- package/packages/core/paper/operations/provisioning.js +0 -113
- package/packages/core/paper/operations/scaffold-config.js +0 -77
- package/packages/core/paper/operations/scaffold-workflows.js +0 -116
- package/packages/core/paper/operations/workspace.js +0 -60
- package/packages/core/paper/paper-npm-bootstrap.js +0 -492
|
@@ -1,509 +1,151 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
title = "Observer-Declared Timelines for Real-World Agent Work"
|
|
30
|
-
version = "0.1.0"
|
|
31
|
-
primary_artifact = "_build/main.pdf"
|
|
32
|
-
artifact_paths = ["_build/main.pdf"]
|
|
33
|
-
metadata_paths = ["README.md", "docs/MAP.md"]
|
|
34
|
-
source_paths = ["paper", "README.md", "LICENSE", "Makefile"]
|
|
35
|
-
site_consumers = ["papers.libkungfu.dev"]
|
|
36
|
-
manifest_path = ".buildchain/publication/publication-artifact.json"
|
|
37
|
-
source_bundle_path = ".buildchain/publication/source.tar.gz"
|
|
38
|
-
|
|
39
|
-
[publication.archive]
|
|
40
|
-
id = "observer-declared-timelines"
|
|
41
|
-
canonical_url = "https://papers.libkungfu.dev/observer-declared-timelines/"
|
|
42
|
-
latest_url = "https://papers.libkungfu.dev/observer-declared-timelines/latest/"
|
|
43
|
-
latest_evidence_url = "https://papers.libkungfu.dev/observer-declared-timelines/latest/buildchain.release.json"
|
|
44
|
-
immutable_base_url = "https://papers.libkungfu.dev/archive"
|
|
45
|
-
registry_path = ".buildchain/publication/publication-registry.json"
|
|
46
|
-
|
|
47
|
-
[publication.toolchain]
|
|
48
|
-
type = "latex-docker"
|
|
49
|
-
image = "ghcr.io/kungfu-systems/build-images/latex-pdf-builder"
|
|
50
|
-
digest = "sha256:c20f3809e96836c1c78e97c76939d12f1de3fed0ea9b7c40c43332ec2ea480f8"
|
|
51
|
-
command = "latexmk -pdf -outdir=_build paper/main.tex"
|
|
52
|
-
|
|
53
|
-
[publish]
|
|
54
|
-
kind = "npm-paper-package"
|
|
55
|
-
package = "@kungfu-tech/paper-observer-declared-timelines"
|
|
56
|
-
auth = "trusted-publishing"
|
|
57
|
-
|
|
58
|
-
[lifecycle.build]
|
|
59
|
-
command = "make pdf"
|
|
60
|
-
|
|
61
|
-
[lifecycle.verify]
|
|
62
|
-
command = "make check"
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
`primary_artifact` is the human-facing publication output, usually a PDF.
|
|
66
|
-
`source_paths` are archived into a source bundle. `metadata_paths` are hashed
|
|
67
|
-
and recorded so a site can consume the paper facts without scraping prose.
|
|
68
|
-
|
|
69
|
-
`publication.archive` turns the publication into an append-only public archive
|
|
70
|
-
contract:
|
|
71
|
-
|
|
72
|
-
- `canonical_url` is the stable human reader page.
|
|
73
|
-
- `latest_url` and `latest_evidence_url` are movable aliases for the latest
|
|
74
|
-
reader page and latest evidence.
|
|
75
|
-
- `immutable_base_url` plus `id` and `publication.version` produce a versioned
|
|
76
|
-
prefix such as
|
|
77
|
-
`https://papers.libkungfu.dev/archive/observer-declared-timelines/v0.1.0/`.
|
|
78
|
-
- `immutable_url_prefix` can be used instead when the repository already owns
|
|
79
|
-
the full version prefix.
|
|
80
|
-
- `registry_path` records every published version and its manifest, passport,
|
|
81
|
-
source bundle, primary artifact, URLs, and SHA-256 digests.
|
|
82
|
-
|
|
83
|
-
Immutable archive prefixes are append-only. Do not run site deployment commands
|
|
84
|
-
with `sync --delete` or equivalent deletion semantics over those prefixes. A
|
|
85
|
-
same-version republish is allowed only when the immutable digest is unchanged;
|
|
86
|
-
if PDF, source bundle, route, metadata, or toolchain evidence changes for an
|
|
87
|
-
existing version, Buildchain fails before the registry is rewritten.
|
|
88
|
-
|
|
89
|
-
The Buildchain web-surface adapter consumes this boundary from a surface-local
|
|
90
|
-
`manifest.json` whose `archivePolicy.contract` is
|
|
91
|
-
`kungfu-buildchain-publication-archive-policy`. It excludes the derived archive
|
|
92
|
-
root from every owning or parent `sync --delete`, verifies existing object
|
|
93
|
-
digests, uploads only missing immutable files with `--no-overwrite`, and verifies
|
|
94
|
-
them again before mutable site content is synchronized. A current package set
|
|
95
|
-
does not need to rebuild or enumerate every historical version: the protected
|
|
96
|
-
archive root remains outside deletion even when older versions disappear from
|
|
97
|
-
the current artifact.
|
|
98
|
-
|
|
99
|
-
`publication.toolchain` makes the source-to-PDF transformation part of the
|
|
100
|
-
machine-readable contract. `latex-docker` is the preferred LaTeX profile. The
|
|
101
|
-
Buildchain paper scaffold and reusable workflow default to
|
|
102
|
-
`ghcr.io/kungfu-systems/build-images/latex-pdf-builder:v1.2.0`, pinned by the
|
|
103
|
-
digest above. The workflow pulls the declared image by digest and runs the
|
|
104
|
-
declared command in that pinned container. `custom-command` remains available
|
|
105
|
-
for compatibility, but the passport records it as lower trust because
|
|
106
|
-
Buildchain can record the command boundary without proving the compiler or
|
|
107
|
-
LaTeX distribution digest.
|
|
108
|
-
|
|
109
|
-
## Reproducibility Gate
|
|
110
|
-
|
|
111
|
-
Alpha and release admission require
|
|
112
|
-
`.buildchain/publication/reproducibility-receipt.json`. Buildchain creates the
|
|
113
|
-
receipt by cloning the exact checked-out Git commit into two independent local
|
|
114
|
-
repositories, assigning each build a separate home and npm cache, and deriving
|
|
115
|
-
`SOURCE_DATE_EPOCH` from the source commit. A pinned `latex-docker` build runs
|
|
116
|
-
with UTC, `C.UTF-8`, no build-time network, and the exact image digest declared
|
|
117
|
-
in `[publication.toolchain]`.
|
|
118
|
-
|
|
119
|
-
Each clean build independently creates the PDF set, source bundle, publication
|
|
120
|
-
manifest and passport, append-only registry, synthesized npm package directory,
|
|
121
|
-
and an actual npm tarball. After qualification, Buildchain copies the first
|
|
122
|
-
qualifying tarball into the promoted publication candidate instead of deleting
|
|
123
|
-
it with the temporary clean build. The receipt compares exact bytes and records:
|
|
124
|
-
|
|
125
|
-
- source repository, commit, tree, and `SOURCE_DATE_EPOCH`;
|
|
126
|
-
- toolchain image, digest, command, and toolchain identity root;
|
|
127
|
-
- every artifact and evidence path with byte size and SHA-256;
|
|
128
|
-
- npm tarball SHA-256, SHA-1 shasum, and `sha512` integrity;
|
|
129
|
-
- per-build output-set roots and the first differing field or artifact.
|
|
130
|
-
|
|
131
|
-
The gate is fail-closed. A build-only `custom-command` run can diagnose byte
|
|
132
|
-
drift and promote its byte-identical local output with
|
|
133
|
-
`--allow-unpinned-toolchain`, but it is never a qualifying publication receipt.
|
|
134
|
-
Any workflow that prepares a publishable paper package accepts only a
|
|
135
|
-
digest-pinned toolchain and promotes the first clean build into the publication
|
|
136
|
-
candidate only after both builds are byte-identical. The receipt remains
|
|
137
|
-
outside the npm tarball to avoid a circular digest; it binds the tarball bytes
|
|
138
|
-
from the surrounding sealed publication evidence.
|
|
139
|
-
|
|
140
|
-
`publish.kind = "npm-paper-package"` declares that Buildchain, not the consumer
|
|
141
|
-
repository, owns the standard paper npm package shape and release transaction
|
|
142
|
-
mechanics. `publish.package` is the public npm package that contains the PDF,
|
|
143
|
-
publication manifest, publication passport, optional archive registry, source
|
|
144
|
-
bundle, and declared metadata files.
|
|
145
|
-
|
|
146
|
-
## Reusable Workflow
|
|
147
|
-
|
|
148
|
-
Consumer repositories that only need to build and upload paper evidence can
|
|
149
|
-
call the build-only wrapper directly:
|
|
150
|
-
|
|
151
|
-
```yaml
|
|
152
|
-
jobs:
|
|
153
|
-
publication:
|
|
154
|
-
uses: kungfu-systems/buildchain/.github/workflows/public-build-publication.yml@v3
|
|
155
|
-
with:
|
|
156
|
-
toolchain-type: config
|
|
157
|
-
verify-command: make check
|
|
158
|
-
artifact-name: observer-declared-timelines
|
|
159
|
-
contract-lock: .buildchain/contract-lock.json
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
The build-only workflow:
|
|
163
|
-
|
|
164
|
-
- resolves the Buildchain runtime and checks the floating contract lock before
|
|
165
|
-
any paper build runs;
|
|
166
|
-
- resolves the declared publication toolchain from `[publication.toolchain]` or
|
|
167
|
-
workflow inputs;
|
|
168
|
-
- hydrates authenticated registry history before building so both clean
|
|
169
|
-
candidates include the same append-only history;
|
|
170
|
-
- for `latex-docker`, pulls the pinned build-images LaTeX builder digest and
|
|
171
|
-
runs two independent clean builds with the reproducibility policy above;
|
|
172
|
-
- for `custom-command`, runs the declared command and records the lower-trust
|
|
173
|
-
boundary in the passport, but refuses publication qualification;
|
|
174
|
-
- runs the verify command;
|
|
175
|
-
- creates a source bundle from `publication.source_paths`;
|
|
176
|
-
- writes `.buildchain/publication/publication-artifact.json`;
|
|
177
|
-
- writes `.buildchain/publication/publication-artifact-passport.json`;
|
|
178
|
-
- writes a qualifying
|
|
179
|
-
`.buildchain/publication/reproducibility-receipt.json`;
|
|
180
|
-
- when `[publication.archive]` is configured, writes
|
|
181
|
-
`.buildchain/publication/publication-registry.json` and verifies same-version
|
|
182
|
-
immutability;
|
|
183
|
-
- uploads one GitHub artifact containing the PDF, manifest, passport, optional
|
|
184
|
-
registry, and source bundle.
|
|
185
|
-
|
|
186
|
-
It does not publish npm packages, deploy web pages, or create GitHub Releases.
|
|
187
|
-
|
|
188
|
-
The paper release preset additionally hydrates every prior published package
|
|
189
|
-
registry from the npm registry before generating the current manifest. npm
|
|
190
|
-
package integrity authenticates each downloaded source; Buildchain verifies the
|
|
191
|
-
registry self-digest, merges immutable records, and fails if a cumulative
|
|
192
|
-
registry drops an accepted version or changes immutable route/artifact facts.
|
|
193
|
-
The synthesized package therefore carries complete history even on a clean
|
|
194
|
-
runner. Its cumulative registry and file SHA-256 values are bound into the paper
|
|
195
|
-
release build summary and release passport evidence.
|
|
196
|
-
|
|
197
|
-
## Paper Release Preset
|
|
198
|
-
|
|
199
|
-
Paper repositories that publish a versioned npm package should use the
|
|
200
|
-
Buildchain-managed release preset instead of copying npm transaction scripts or
|
|
201
|
-
promotion YAML:
|
|
202
|
-
|
|
203
|
-
```yaml
|
|
204
|
-
name: Paper Release
|
|
205
|
-
|
|
206
|
-
on:
|
|
207
|
-
push:
|
|
208
|
-
branches:
|
|
209
|
-
- alpha/v1/v1.0
|
|
210
|
-
- release/v1/v1.0
|
|
211
|
-
workflow_dispatch:
|
|
212
|
-
|
|
213
|
-
jobs:
|
|
214
|
-
paper-release:
|
|
215
|
-
uses: kungfu-systems/buildchain/.github/workflows/public-release-paper.yml@v4
|
|
216
|
-
permissions:
|
|
217
|
-
actions: read
|
|
218
|
-
checks: write
|
|
219
|
-
contents: read
|
|
220
|
-
id-token: write
|
|
221
|
-
issues: write
|
|
222
|
-
with:
|
|
223
|
-
publisher-workflow-path: .github/workflows/public-release-paper.yml
|
|
224
|
-
toolchain-type: config
|
|
225
|
-
verify-command: make check
|
|
226
|
-
artifact-paths: _build/paper-name.pdf
|
|
227
|
-
contract-lock: .buildchain/contract-lock.json
|
|
228
|
-
secrets:
|
|
229
|
-
BUILDCHAIN_GENERATED_WRITE_APP_CLIENT_ID: ${{ secrets.BUILDCHAIN_GENERATED_WRITE_APP_CLIENT_ID }}
|
|
230
|
-
BUILDCHAIN_GENERATED_WRITE_APP_PRIVATE_KEY: ${{ secrets.BUILDCHAIN_GENERATED_WRITE_APP_PRIVATE_KEY }}
|
|
231
|
-
BUILDCHAIN_GENERATED_WRITE_TOKEN: ${{ secrets.BUILDCHAIN_GENERATED_WRITE_TOKEN }}
|
|
232
|
-
```
|
|
233
|
-
|
|
234
|
-
The sealed preset does not use a long-lived token for npm publication. It
|
|
235
|
-
prefers a repository-scoped GitHub App installation token for generated
|
|
236
|
-
repository writes and accepts `BUILDCHAIN_GENERATED_WRITE_TOKEN` as an
|
|
237
|
-
equivalent narrow compatibility authority. The deprecated
|
|
238
|
-
`BUILDCHAIN_PROMOTION_TOKEN` name remains accepted for existing consumers, but
|
|
239
|
-
there is no `github.token` fallback for generated writes. npm publication
|
|
240
|
-
remains bound to GitHub OIDC trusted publishing. The preset builds and packages the
|
|
241
|
-
paper in a read-only job, then a credential-free authority job downloads that
|
|
242
|
-
exact candidate, audits the external control plane, and seals a capability over
|
|
243
|
-
the source tree, Buildchain runtime, controller receipt, PDF, and npm package
|
|
244
|
-
bytes. Only the final job receives write and OIDC permissions; it downloads the
|
|
245
|
-
admitted candidate, recomputes the capability binding, and publishes without
|
|
246
|
-
executing consumer build commands. npm binds the OIDC identity to the consumer
|
|
247
|
-
workflow named by `publisher-workflow-path`.
|
|
248
|
-
|
|
249
|
-
The preset:
|
|
250
|
-
|
|
251
|
-
- uses the exact Buildchain SHA admitted by the provisioning authority and
|
|
252
|
-
binds it into the caller bytes, contract lock, publication candidate, and
|
|
253
|
-
authority capability;
|
|
254
|
-
- builds the PDF through the declared pinned LaTeX Docker toolchain or custom
|
|
255
|
-
command in a read-only job;
|
|
256
|
-
- verifies the paper repository;
|
|
257
|
-
- writes the publication manifest, publication passport, optional archive
|
|
258
|
-
registry, and source bundle;
|
|
259
|
-
- synthesizes an npm package from `[publication]` and `[publish]` declarations
|
|
260
|
-
under `.buildchain/publication/npm-package`;
|
|
261
|
-
- computes npm-style `sha512` integrity from `npm pack --dry-run` and passes
|
|
262
|
-
it as `publish-required-artifacts-json`;
|
|
263
|
-
- creates a `publish-gate/<alpha|release>/.../<version>` source lock for the
|
|
264
|
-
channel commit and requires `promote-buildchain-ref` to verify that lock
|
|
265
|
-
before any publish side effect;
|
|
266
|
-
- verifies the complete candidate again after authority and publishes the
|
|
267
|
-
package through npm Trusted Publishing without rebuilding or repacking it;
|
|
268
|
-
- writes a typed sealed-bundle manifest that binds the candidate root, exact
|
|
269
|
-
npm tarball, every GitHub Release asset, durable storage path, and resume
|
|
270
|
-
command;
|
|
271
|
-
- persists the complete binary bundle to the transaction's durable release-state
|
|
272
|
-
ref before npm receives credentials, allowing an empty runner to restore and
|
|
273
|
-
verify the same bytes after interruption;
|
|
274
|
-
- writes Buildchain release/passport evidence; and
|
|
275
|
-
- creates or updates the exact-version GitHub Release by default, uploading
|
|
276
|
-
every file declared by `publication.primary_artifact` and
|
|
277
|
-
`publication.artifact_paths` alongside the release evidence.
|
|
278
|
-
|
|
279
|
-
Consumers can opt out of the GitHub Release with `github-release: false`, but
|
|
280
|
-
the default is on so downstream release propagation can observe
|
|
281
|
-
`release.published` without hand-written `gh release` steps.
|
|
282
|
-
|
|
283
|
-
The transaction exposes a stable publication progression:
|
|
284
|
-
|
|
285
|
-
```text
|
|
286
|
-
prepared -> sealed -> package-published -> alpha-complete
|
|
287
|
-
```
|
|
288
|
-
|
|
289
|
-
Stable publication ends at `release-complete`. If a run stops after npm but
|
|
290
|
-
before GitHub Release completion, the next run starts from
|
|
291
|
-
`package-published`, restores the sealed PDF and companion assets, and finishes
|
|
292
|
-
the release without invoking the paper build or `npm pack` again.
|
|
293
|
-
|
|
294
|
-
Declared publication artifacts are resolved from the generated publication
|
|
295
|
-
manifest rather than repeated in consumer workflow YAML. Publication fails
|
|
296
|
-
before upload if a declared artifact is missing or if its basename would
|
|
297
|
-
collide with another GitHub Release asset.
|
|
298
|
-
|
|
299
|
-
For npm Trusted Publishing, register the consumer workflow file that calls this
|
|
300
|
-
preset, for example `.github/workflows/public-release-paper.yml`, against the declared
|
|
301
|
-
package in npm. The trusted publisher is the consumer repository and workflow
|
|
302
|
-
file; the implementation still runs inside Buildchain's reusable workflow.
|
|
303
|
-
|
|
304
|
-
Standard paper repositories should not carry local copies of
|
|
305
|
-
`packages/core/publication/commands/npm-publish-transaction.mjs`, package-generation scripts, or
|
|
306
|
-
promotion/ref-lock YAML. If the default package shape is insufficient, extend
|
|
307
|
-
Buildchain rather than forking the mechanics into each paper repository.
|
|
308
|
-
|
|
309
|
-
## CLI And Node API
|
|
310
|
-
|
|
311
|
-
### Unified paper operator surface
|
|
312
|
-
|
|
313
|
-
The `buildchain paper` command family assembles the existing publication
|
|
314
|
-
primitives into a resumable operator flow:
|
|
315
|
-
|
|
316
|
-
```text
|
|
317
|
-
scaffold/new or migrate/existing -> preflight -> bootstrap npm -> build -> alpha -> status -> resume
|
|
318
|
-
```
|
|
319
|
-
|
|
320
|
-
Each command emits a typed JSON envelope with `--json`. Dry-run is the default
|
|
321
|
-
for every external mutation. `scaffold --write` is limited to no-overwrite
|
|
322
|
-
local file creation. `migrate --write` is limited to the Buildchain-owned
|
|
323
|
-
contract lock, version pin, thin workflows, and provisioning authority; paper
|
|
324
|
-
content and publication configuration are preserved. `bootstrap npm --execute`, `alpha --execute`, and
|
|
325
|
-
`resume --execute` cross external authority boundaries and therefore require
|
|
326
|
-
explicit execution.
|
|
327
|
-
|
|
328
|
-
The evidence model is intentionally non-inferential:
|
|
329
|
-
|
|
330
|
-
| State | Required evidence |
|
|
331
|
-
| -------------------- | -------------------------------------------------------- |
|
|
332
|
-
| `scaffolded` | Complete managed scaffold inventory |
|
|
333
|
-
| `governed` | Compatible Buildchain contract lock |
|
|
334
|
-
| `admitted` | Repository admission receipt |
|
|
335
|
-
| `bootstrapped` | Successful public npm bootstrap receipt or registry fact |
|
|
336
|
-
| `trust-bound` | Trusted publisher binding receipt |
|
|
337
|
-
| `content-ready` | Declared source paths present |
|
|
338
|
-
| `artifact-sealed` | Verified sealed publication bundle |
|
|
339
|
-
| `package-published` | Exact package version visible in npm |
|
|
340
|
-
| `alpha-complete` | Protected Alpha PR completion evidence |
|
|
341
|
-
| `staging-visible` | Staging route evidence |
|
|
342
|
-
| `production-visible` | Production route evidence |
|
|
343
|
-
|
|
344
|
-
`paper status` reports `satisfied`, `not-reached`, `blocked`, or `unknown` for
|
|
345
|
-
each state. It does not promote a state merely because a prior state is
|
|
346
|
-
complete. This makes a later `paper resume` safe: the command dispatches the
|
|
347
|
-
thin repository release workflow, while the workflow re-verifies durable
|
|
348
|
-
evidence and remains the publication authority.
|
|
349
|
-
|
|
350
|
-
Operationally, responsibility remains split:
|
|
351
|
-
|
|
352
|
-
- the paper repository owns content, declared metadata, and its thin
|
|
353
|
-
build/release workflow;
|
|
354
|
-
- Buildchain owns scaffold shape, evidence contracts, reproducibility, sealed
|
|
355
|
-
bundle mechanics, npm transaction mechanics, and resumption planning;
|
|
356
|
-
- GitHub branch protection and trusted publishing own authority transitions;
|
|
357
|
-
- the papers site consumes publication evidence and owns reader-facing
|
|
358
|
-
rendering.
|
|
359
|
-
|
|
360
|
-
Daily work begins and ends through the repository-pinned v3 CLI:
|
|
1
|
+
---
|
|
2
|
+
status: draft
|
|
3
|
+
period: ongoing
|
|
4
|
+
theme: paper-consumer
|
|
5
|
+
doc_type: implementation-guide
|
|
6
|
+
source_level: local-files
|
|
7
|
+
confidence: high
|
|
8
|
+
sensitivity: public
|
|
9
|
+
evidence_grade: B
|
|
10
|
+
review_state: unreviewed
|
|
11
|
+
last_reviewed: 2026-09-20
|
|
12
|
+
ai_provenance:
|
|
13
|
+
model_family: GPT-6
|
|
14
|
+
product: Codex
|
|
15
|
+
generated_at: 2026-09-20
|
|
16
|
+
visible_context: Schema-2 product compiler, shared caller templates and Paper source scaffold.
|
|
17
|
+
invisible_context_boundary: No downstream repository migration or hosted Paper release is claimed.
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
# Paper products
|
|
21
|
+
|
|
22
|
+
A Paper repository owns its source, build commands, verification commands and
|
|
23
|
+
PDF output. It uses the same two Buildchain caller files as npm and binary
|
|
24
|
+
products. The published pipeline owns delivery, publication and recovery.
|
|
25
|
+
|
|
26
|
+
## Create or adopt a source tree
|
|
27
|
+
|
|
28
|
+
For an existing paper with working `make pdf` and `make check` commands:
|
|
361
29
|
|
|
362
30
|
```sh
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
pnpm paper:work:submit
|
|
31
|
+
buildchain init --type paper
|
|
32
|
+
buildchain validate --require-lifecycle-stages build,verify
|
|
366
33
|
```
|
|
367
34
|
|
|
368
|
-
|
|
369
|
-
local HEAD to equal the exact canonical remote development SHA. The submit plan
|
|
370
|
-
allows only a non-protected work branch containing that SHA, a clean committed
|
|
371
|
-
tree, a normal fast-forward push, and a pull request back to the same derived
|
|
372
|
-
development branch. Neither command force-pushes, guesses a fork target, or
|
|
373
|
-
silently fetches and merges stale state.
|
|
374
|
-
|
|
375
|
-
Maintainers can inspect a sibling fleet without per-repository command copies:
|
|
35
|
+
To generate a new LaTeX source tree, inspect the plan and then write it:
|
|
376
36
|
|
|
377
37
|
```sh
|
|
378
|
-
buildchain paper
|
|
379
|
-
|
|
38
|
+
buildchain paper scaffold --name paper-example --title "Example Paper" \
|
|
39
|
+
--repository example/paper-example --json
|
|
40
|
+
buildchain paper scaffold --name paper-example --title "Example Paper" \
|
|
41
|
+
--repository example/paper-example --write --json
|
|
380
42
|
```
|
|
381
43
|
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
44
|
+
The scaffold contains the paper, bibliography, Makefile, license, product
|
|
45
|
+
manifest, documentation, schema-2 TOML and shared caller pair. It creates no
|
|
46
|
+
repository-side provisioning authority, agent-entry JSON or release controller.
|
|
47
|
+
Existing conflicting files, extra workflows and symlinked write parents stop
|
|
48
|
+
writing before another planned file is created. Repeating an unchanged plan is
|
|
49
|
+
idempotent.
|
|
386
50
|
|
|
387
|
-
|
|
51
|
+
The new Makefile builds LaTeX in a digest-pinned container with networking
|
|
52
|
+
disabled for the build. Running it requires Docker and the referenced image.
|
|
53
|
+
`make check` checks the source files and Git whitespace; add product-specific
|
|
54
|
+
content and PDF checks there as needed. A single successful build is not a
|
|
55
|
+
proof of reproducibility across independent builds.
|
|
388
56
|
|
|
389
|
-
|
|
390
|
-
buildchain paper preflight --offline --json
|
|
391
|
-
buildchain paper status --json
|
|
392
|
-
```
|
|
57
|
+
## Product configuration
|
|
393
58
|
|
|
394
|
-
|
|
59
|
+
The generated `.buildchain/buildchain.toml` includes a Paper product:
|
|
395
60
|
|
|
396
|
-
```
|
|
397
|
-
|
|
398
|
-
|
|
61
|
+
```toml
|
|
62
|
+
[[products]]
|
|
63
|
+
id = "main"
|
|
64
|
+
type = "paper"
|
|
65
|
+
platforms = ["linux-x64"]
|
|
66
|
+
build = ["make pdf"]
|
|
67
|
+
verify = ["make check"]
|
|
399
68
|
|
|
400
|
-
|
|
69
|
+
[[products.artifacts]]
|
|
70
|
+
id = "main"
|
|
71
|
+
path = "_build/main.pdf"
|
|
72
|
+
kind = "pdf"
|
|
401
73
|
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
--confirm-public-package @kungfu-tech/paper-example \
|
|
406
|
-
--json
|
|
74
|
+
[[products.targets]]
|
|
75
|
+
provider = "github-release"
|
|
76
|
+
artifacts = ["main"]
|
|
407
77
|
```
|
|
408
78
|
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
```
|
|
79
|
+
This is the product portion of the generated configuration. Keep its schema,
|
|
80
|
+
version, channels and protected-review policy sections as well. Product commands
|
|
81
|
+
may change with the source tree; the two caller files remain identical across
|
|
82
|
+
product types:
|
|
414
83
|
|
|
415
|
-
|
|
84
|
+
- `.github/workflows/buildchain.yml` calls the common normal pipeline.
|
|
85
|
+
- `.github/workflows/buildchain-recover.yml` calls exact-attempt recovery.
|
|
416
86
|
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
```
|
|
87
|
+
The source package is private. Its `version` is the product version authority;
|
|
88
|
+
its description and optional homepage retain the paper's title and site URL.
|
|
89
|
+
`--package` optionally sets this source identity and does not add an npm target.
|
|
90
|
+
When adopting a source tree without a versioned package manifest, `init` creates
|
|
91
|
+
`release.json` as the version authority instead.
|
|
423
92
|
|
|
424
|
-
|
|
93
|
+
## Validate and publish
|
|
425
94
|
|
|
426
95
|
```sh
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
```js
|
|
433
|
-
import {
|
|
434
|
-
collectPublicationArtifact,
|
|
435
|
-
writePublicationArtifact,
|
|
436
|
-
} from "@kungfu-tech/buildchain/publication-artifact";
|
|
437
|
-
|
|
438
|
-
import {
|
|
439
|
-
collectPublicationPackageFacts,
|
|
440
|
-
preparePublicationNpmPackage,
|
|
441
|
-
} from "@kungfu-tech/buildchain/publication-package";
|
|
442
|
-
|
|
443
|
-
import { verifyPublicationReproducibility } from "@kungfu-tech/buildchain/publication-reproducibility";
|
|
444
|
-
|
|
445
|
-
import {
|
|
446
|
-
createPublicationSealedBundle,
|
|
447
|
-
verifyPublicationSealedBundle,
|
|
448
|
-
} from "@kungfu-tech/buildchain/publication-sealed-bundle";
|
|
449
|
-
```
|
|
450
|
-
|
|
451
|
-
`writePublicationArtifact()` is the single implementation used by the CLI and
|
|
452
|
-
the reusable workflow. The generated manifest records:
|
|
453
|
-
|
|
454
|
-
- publication title, kind, authors, and primary artifact;
|
|
455
|
-
- artifact paths, byte sizes, and SHA-256 digests;
|
|
456
|
-
- metadata paths and SHA-256 digests;
|
|
457
|
-
- source SHA, tree SHA, source files, and source bundle digest;
|
|
458
|
-
- publication toolchain type, image, digest, command, invocation mode, and trust
|
|
459
|
-
classification;
|
|
460
|
-
- timestamp and reproducibility policy;
|
|
461
|
-
- downstream site-consumption hints;
|
|
462
|
-
- optional archive routes for canonical, latest, latest evidence, immutable
|
|
463
|
-
version prefix, and public artifact URLs.
|
|
464
|
-
|
|
465
|
-
The companion publication artifact passport records the same source and
|
|
466
|
-
artifact evidence plus an explicit responsibility split. Buildchain proves
|
|
467
|
-
declared files and hashes; it does not peer-review paper claims.
|
|
468
|
-
|
|
469
|
-
When archive config is present, the registry uses the
|
|
470
|
-
`kungfu-buildchain-publication-artifact-registry` contract. A site repository
|
|
471
|
-
can render latest pages and historical version indexes from that registry
|
|
472
|
-
without rebuilding old PDFs from the latest npm package or paper source.
|
|
473
|
-
|
|
474
|
-
## Site Consumption
|
|
475
|
-
|
|
476
|
-
A downstream papers site should treat the publication manifest as the single
|
|
477
|
-
fact source for the artifact. The site owns rendering and navigation; it should
|
|
478
|
-
not reinterpret the paper repository as a web deployment source.
|
|
479
|
-
For registry-level routing, sites should first consume the package-owned
|
|
480
|
-
Buildchain fact source:
|
|
481
|
-
|
|
482
|
-
```text
|
|
483
|
-
node_modules/@kungfu-tech/buildchain/dist/site/publication-registry.json
|
|
484
|
-
```
|
|
485
|
-
|
|
486
|
-
or the equivalent package export:
|
|
487
|
-
|
|
488
|
-
```js
|
|
489
|
-
import registry from "@kungfu-tech/buildchain/site/publication-registry.json" with { type: "json" };
|
|
490
|
-
```
|
|
491
|
-
|
|
492
|
-
That registry uses the `kungfu-buildchain-publication-release-registry`
|
|
493
|
-
contract. It separates mutable canonical/latest reader routes from immutable
|
|
494
|
-
version prefixes, publication artifacts, source bundles, and passport evidence
|
|
495
|
-
so site repositories can render `/papers/**` without maintaining a parallel
|
|
496
|
-
fixture truth source.
|
|
497
|
-
|
|
498
|
-
For `paper-observer-declared-timelines`, the expected adoption path is:
|
|
499
|
-
|
|
500
|
-
```text
|
|
501
|
-
paper repo builds PDF + manifest + source bundle
|
|
502
|
-
paper repo updates publication-registry.json
|
|
503
|
-
papers site consumes publication-artifact.json
|
|
504
|
-
papers site consumes publication-registry.json for history
|
|
505
|
-
site renders paper page and links the PDF/source bundle
|
|
96
|
+
make pdf
|
|
97
|
+
make check
|
|
98
|
+
buildchain validate --require-lifecycle-stages build,verify
|
|
99
|
+
buildchain paper preflight --json
|
|
100
|
+
buildchain paper status --json
|
|
506
101
|
```
|
|
507
102
|
|
|
508
|
-
|
|
509
|
-
|
|
103
|
+
For schema-2 Paper repositories, preflight and status check local product policy
|
|
104
|
+
and exact caller bytes. They return `localOnly: true` and
|
|
105
|
+
`publication.status: "not-observed"`. They do not contact npm or GitHub accounts,
|
|
106
|
+
and their success does not prove hosted admission, a successful build or a
|
|
107
|
+
published release.
|
|
108
|
+
|
|
109
|
+
Open a PR on the configured protected channel route to request delivery or
|
|
110
|
+
publication. Supply the common repository permissions and tool-maintained
|
|
111
|
+
runtime locks required by the published entry. Recover a failed operation using
|
|
112
|
+
its exact attempt identifier in the shared recovery workflow. An optional
|
|
113
|
+
repaired runtime applies to that recovery; do not persist it in product callers.
|
|
114
|
+
|
|
115
|
+
## Existing papers and downstream sites
|
|
116
|
+
|
|
117
|
+
The former schema-1 npm-paper scaffold used separate product workflows and
|
|
118
|
+
repository-side control records. It is no longer generated for new papers.
|
|
119
|
+
Moving an existing paper to this contract changes its publication target to PDF
|
|
120
|
+
assets in GitHub Releases. Review that target change and downstream consumption
|
|
121
|
+
before migrating an existing repository; `init --force` does not absorb old
|
|
122
|
+
workflows or silently convert their product behavior.
|
|
123
|
+
|
|
124
|
+
`buildchain paper migrate --json` plans the conversion from a clean committed
|
|
125
|
+
source. It retains declared build/verification commands, moves publication
|
|
126
|
+
metadata into `paper/publication-metadata.json`, and makes the private source
|
|
127
|
+
package's version authoritative. `--write` applies the reviewed changes and
|
|
128
|
+
removes only recognized legacy callers and digest-checked controller files.
|
|
129
|
+
Custom workflows, conflicting version authorities, extra configuration sections,
|
|
130
|
+
and unrepresentable lifecycle settings fail before writing. Runtime locks and
|
|
131
|
+
historical receipts remain byte-identical; channel-root overrides are retired.
|
|
132
|
+
A later source change invalidates the plan. Refresh the dependency lockfile if
|
|
133
|
+
the plan updates an optional local Buildchain CLI dependency.
|
|
134
|
+
|
|
135
|
+
Keep already published npm versions, original PDF bytes and retained publication
|
|
136
|
+
receipts as historical evidence. A new local configuration does not rewrite or
|
|
137
|
+
requalify those releases. Existing append-only archives retain their immutability
|
|
138
|
+
rules. Sites own rendering, navigation and archive import; they must consume the
|
|
139
|
+
actual selected release and its evidence rather than infer a new npm publication
|
|
140
|
+
from a Paper configuration or successful local check.
|
|
141
|
+
|
|
142
|
+
## Retired Paper execution commands
|
|
143
|
+
|
|
144
|
+
The schema-2 Paper interface no longer exposes `paper bootstrap npm`,
|
|
145
|
+
`paper build`, `paper alpha`, or `paper resume`. These commands depended on
|
|
146
|
+
legacy publication configuration and separate workflow wiring. Use the product
|
|
147
|
+
build/verification commands declared in TOML, a legal channel PR to request
|
|
148
|
+
publication, and the generated recovery caller with an exact attempt. The
|
|
149
|
+
generic product reproducibility tools remain available; this change does not
|
|
150
|
+
rewrite published artifacts or historical receipts. Legacy status/preflight
|
|
151
|
+
readers direct users to the migration preview.
|