@kungfu-tech/buildchain 3.0.4-alpha.1 → 3.0.4-alpha.11
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 +14 -5
- package/README.md +18 -0
- package/bin/buildchain.mjs +136 -73
- package/bin/internal/trust-release-cli.mjs +15 -537
- package/bin/internal/trust-release-command-handlers.mjs +14 -0
- package/bin/internal/trust-release-inspection-handlers.mjs +175 -0
- package/bin/internal/trust-release-release-handlers.mjs +317 -0
- package/bin/internal/trust-release-verification-handlers.mjs +306 -0
- package/dist/site/buildchain-contract.json +35 -24
- package/dist/site/buildchain-site.json +1474 -61
- package/dist/site/capability-registry.json +8 -5
- package/dist/site/cli-registry.json +1869 -0
- package/dist/site/controller-registry.json +16 -3
- package/dist/site/kfd-claims.json +84 -10
- package/dist/site/kfd-upstream-aggregate.json +1 -1
- package/dist/site/manual-registry.json +49 -6
- package/dist/site/node-api-registry.json +17802 -11
- package/dist/site/page-registry.json +1441 -59
- package/dist/site/public-surface-audit.json +2863 -358
- package/dist/site/publication-registry.json +4 -4
- package/dist/site/release-model.json +7 -0
- package/dist/site/site-manifest.json +34 -10
- package/dist/site/workflow-registry.json +13 -5
- package/docs/MAP.md +21 -6
- package/docs/cli-reference.md +1936 -0
- package/docs/cli.md +15 -1
- package/docs/getting-started.md +167 -0
- package/docs/install.md +7 -8
- package/docs/node-api-reference.md +1952 -0
- package/docs/release-propagation.md +166 -8
- package/docs/site-bundle-contract.md +10 -4
- package/docs/versioning.md +5 -4
- package/package.json +8 -5
- package/packages/core/buildchain-agent-manuals.js +37 -0
- package/packages/core/buildchain-kfd-claims.js +4 -37
- package/packages/core/controller-evidence.js +8 -1
- package/packages/core/index.js +1 -13
- package/packages/core/paper-agent-entry.js +14 -11
- package/packages/core/paper-fleet.js +34 -7
- package/packages/core/paper-npm-bootstrap.js +492 -0
- package/packages/core/paper-repository.js +1 -0
- package/packages/core/paper.js +346 -671
- package/packages/core/public-surface-cli.js +12 -1
- package/packages/core/publication-package.js +7 -0
- package/packages/core/release-passport.js +67 -71
- package/packages/core/release-propagation-common.js +64 -0
- package/packages/core/release-propagation-execution-profile.js +59 -0
- package/packages/core/release-propagation-release.js +196 -0
- package/packages/core/release-propagation-stage-evidence.js +364 -0
- package/packages/core/release-propagation-work-capture.js +64 -0
- package/packages/core/release-propagation-work-constants.js +34 -0
- package/packages/core/release-propagation-work-control.js +203 -0
- package/packages/core/release-propagation-work-transitions.js +145 -0
- package/packages/core/release-propagation-work.js +517 -0
- package/packages/core/release-propagation.js +34 -158
- package/scripts/aws-windows-jit-controller-core.mjs +269 -0
- package/scripts/aws-windows-jit-controller.mjs +502 -0
- package/scripts/check-internal-architecture.mjs +178 -52
- package/scripts/check-inventory.mjs +2 -2
- package/scripts/check-maintainability.mjs +76 -17
- package/scripts/generate-public-reference.mjs +68 -0
- package/scripts/generate-site-bundle.mjs +35 -41
- package/scripts/maintainability-metrics.mjs +24 -4
- package/scripts/paper-work-fleet-cli.mjs +22 -3
- package/scripts/public-reference.mjs +557 -0
- package/scripts/release-propagation.mjs +126 -0
- package/scripts/resolve-artifact-transfer-mode.mjs +117 -0
- package/scripts/site-reference-registry.mjs +174 -0
- package/scripts/verify-golden-path.mjs +169 -0
- package/scripts/web-surface-core.mjs +46 -207
- package/scripts/web-surface-routing.mjs +286 -0
package/docs/cli.md
CHANGED
|
@@ -51,7 +51,8 @@ published, pnpm may block the install through a minimum release-age policy. In
|
|
|
51
51
|
that case, add a temporary package/version-specific `minimumReleaseAgeExclude`
|
|
52
52
|
entry, such as `@kungfu-tech/buildchain@3.0.0`, and remove it once the package
|
|
53
53
|
has aged past the normal policy window. Do not replace that with a broad
|
|
54
|
-
registry or scope-wide exclude.
|
|
54
|
+
registry or scope-wide exclude. Paper scaffold and migration maintain the
|
|
55
|
+
exact current entry in `pnpm-workspace.yaml` before refreshing the lockfile.
|
|
55
56
|
|
|
56
57
|
Use the package API directly inside JavaScript build scripts:
|
|
57
58
|
|
|
@@ -111,6 +112,19 @@ Use `dist/site/manual-registry.json` to find the packaged operating manuals and
|
|
|
111
112
|
their SHA-256 digests. Use `dist/site/buildchain-contract.json` to verify the
|
|
112
113
|
floating-ref contract world for a runtime such as `@v3`.
|
|
113
114
|
|
|
115
|
+
For exhaustive lookup, use the generated references rather than scanning this
|
|
116
|
+
conceptual guide:
|
|
117
|
+
|
|
118
|
+
- [`cli-reference.md`](cli-reference.md) is projected from the governed usage
|
|
119
|
+
model and runtime command registry. `buildchain <path> --help` is intercepted
|
|
120
|
+
before dispatch at every listed path, exits zero, and has no command side
|
|
121
|
+
effects.
|
|
122
|
+
- [`node-api-reference.md`](node-api-reference.md) is projected from
|
|
123
|
+
`package.json#exports` and exact ESM export declarations. The packaged
|
|
124
|
+
`dist/site/node-api-registry.json` carries the same per-symbol signatures,
|
|
125
|
+
parameters, conservative return/error boundaries, side-effect classification,
|
|
126
|
+
maturity, example import, and source location.
|
|
127
|
+
|
|
114
128
|
## Commands
|
|
115
129
|
|
|
116
130
|
`buildchain create github-artifact-attestation-policy` seals the expected
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
---
|
|
2
|
+
status: active
|
|
3
|
+
period: ongoing
|
|
4
|
+
theme: buildchain-golden-path
|
|
5
|
+
doc_type: technical-guide
|
|
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-01
|
|
12
|
+
ai_provenance:
|
|
13
|
+
model_family: GPT-5
|
|
14
|
+
product: Codex
|
|
15
|
+
generated_at: 2026-08-01
|
|
16
|
+
invisible_context: not asserted
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
# Buildchain Golden Path
|
|
20
|
+
|
|
21
|
+
This path is for a repository maintainer adopting Buildchain for the first
|
|
22
|
+
time. It takes about 15–30 minutes and ends with five inspectable outcomes: an
|
|
23
|
+
exact package pin, a declared project type, a valid local configuration, a thin
|
|
24
|
+
reusable workflow caller, and a Release Passport inspection.
|
|
25
|
+
|
|
26
|
+
Use this page for the first successful pass. Move to the advanced manuals only
|
|
27
|
+
after the local checks below are green.
|
|
28
|
+
|
|
29
|
+
## 1. Create a clean consumer and install an exact version
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
consumer_dir="$(mktemp -d)"
|
|
33
|
+
cd "$consumer_dir"
|
|
34
|
+
npm init -y
|
|
35
|
+
buildchain_version="$(npm view @kungfu-tech/buildchain version)"
|
|
36
|
+
pnpm add -D "@kungfu-tech/buildchain@$buildchain_version"
|
|
37
|
+
pnpm exec buildchain --version
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
The package manager records the exact resolved version in `package.json` and
|
|
41
|
+
the lockfile. Review that version before committing it; do not leave a floating
|
|
42
|
+
range in a release repository.
|
|
43
|
+
|
|
44
|
+
## 2. Choose the project type and initialize
|
|
45
|
+
|
|
46
|
+
Start with `package` for a Node package. Other supported types are `native`,
|
|
47
|
+
`web-surface`, `infra-contract`, `publication-artifact`, and
|
|
48
|
+
`anchored-package`.
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
pnpm exec buildchain init --type package --package-manager pnpm
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Inspect the two generated files before continuing:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
sed -n '1,220p' .buildchain/buildchain.toml
|
|
58
|
+
sed -n '1,220p' .github/workflows/build.yml
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
`buildchain.toml` owns repository lifecycle declarations. The workflow is a
|
|
62
|
+
thin caller of Buildchain's reusable workflow; it is not a second release
|
|
63
|
+
implementation.
|
|
64
|
+
|
|
65
|
+
## 3. Validate the local contract
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
pnpm exec buildchain validate \
|
|
69
|
+
--require-version-state \
|
|
70
|
+
--require-lifecycle-stages install,build,verify
|
|
71
|
+
pnpm exec buildchain doctor --json
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
If the generated lifecycle commands do not match the repository, edit only
|
|
75
|
+
`.buildchain/buildchain.toml`, then rerun both checks. See
|
|
76
|
+
[Lifecycle Protocol](lifecycle-protocol.md) for the normative fields.
|
|
77
|
+
|
|
78
|
+
## 4. Inspect the reusable workflow and release dry-run
|
|
79
|
+
|
|
80
|
+
The generated caller should contain one reusable `uses:` edge and a manual
|
|
81
|
+
`buildchain-ref` input for bounded train validation:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
rg -n 'uses:|buildchain-ref:' .github/workflows/build.yml
|
|
85
|
+
pnpm exec buildchain release --dry-run \
|
|
86
|
+
--target-ref alpha/v3/v3.0 \
|
|
87
|
+
--json
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
The dry-run explains legal source refs, tags, version state, and publication
|
|
91
|
+
effects. It does not move refs, edit files, or publish packages.
|
|
92
|
+
|
|
93
|
+
## 5. Create and inspect a local Release Passport example
|
|
94
|
+
|
|
95
|
+
This example creates a source-bound local Passport through the public Node API,
|
|
96
|
+
then reads it through the CLI. It is learning evidence, not publication
|
|
97
|
+
authority.
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
mkdir -p .buildchain/golden-path
|
|
101
|
+
node --input-type=module <<'EOF'
|
|
102
|
+
import fs from "node:fs";
|
|
103
|
+
import { createReleasePassport } from "@kungfu-tech/buildchain";
|
|
104
|
+
|
|
105
|
+
const passport = createReleasePassport({
|
|
106
|
+
repository: "example/consumer",
|
|
107
|
+
tag: "v0.1.0-alpha.0",
|
|
108
|
+
sourceSha: "a".repeat(40),
|
|
109
|
+
assets: [{ name: "consumer.tgz", sha256: "b".repeat(64) }],
|
|
110
|
+
});
|
|
111
|
+
fs.writeFileSync(
|
|
112
|
+
".buildchain/golden-path/buildchain.release.json",
|
|
113
|
+
`${JSON.stringify(passport, null, 2)}\n`,
|
|
114
|
+
);
|
|
115
|
+
EOF
|
|
116
|
+
|
|
117
|
+
pnpm exec buildchain inspect release \
|
|
118
|
+
--passport .buildchain/golden-path/buildchain.release.json \
|
|
119
|
+
--json
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
For a real release, the protected Buildchain workflow creates the Passport from
|
|
123
|
+
the exact source, artifact, controller, and publication evidence. See
|
|
124
|
+
[Release Passport](release-passport.md); do not promote this local example.
|
|
125
|
+
|
|
126
|
+
## You are done when
|
|
127
|
+
|
|
128
|
+
- the dependency and lockfile contain one exact Buildchain version;
|
|
129
|
+
- `.buildchain/buildchain.toml` declares the intended project type and lifecycle;
|
|
130
|
+
- `validate` and `doctor` succeed;
|
|
131
|
+
- `.github/workflows/build.yml` remains a thin reusable-workflow caller;
|
|
132
|
+
- the release dry-run and local Passport inspection both return structured output.
|
|
133
|
+
|
|
134
|
+
The repository test `pnpm run check:golden-path` reproduces this path in a new
|
|
135
|
+
temporary consumer using the locally packed Buildchain package.
|
|
136
|
+
|
|
137
|
+
## Choose the next manual
|
|
138
|
+
|
|
139
|
+
| Intent | Next page |
|
|
140
|
+
| --- | --- |
|
|
141
|
+
| Change lifecycle commands or version files | [Lifecycle Protocol](lifecycle-protocol.md) |
|
|
142
|
+
| Configure native matrices, runners, caches, or artifacts | [Reusable Build Surface](reusable-build-surface.md) |
|
|
143
|
+
| Look up a command | [Generated CLI Reference](cli-reference.md) |
|
|
144
|
+
| Import the Node toolkit | [Generated Node API Reference](node-api-reference.md) |
|
|
145
|
+
| Understand protected branches and tags | [Release Flow](release-flow.md) |
|
|
146
|
+
| Verify published evidence | [Release Passport](release-passport.md) |
|
|
147
|
+
|
|
148
|
+
## Troubleshooting
|
|
149
|
+
|
|
150
|
+
- `already exists`: initialization is no-overwrite by default. Inspect the
|
|
151
|
+
existing files; use `--force` only for an intentional replacement.
|
|
152
|
+
- missing lifecycle stage: add the named stage to
|
|
153
|
+
`.buildchain/buildchain.toml`; do not weaken the validation command.
|
|
154
|
+
- package release-age policy: add a temporary, package-and-version-specific
|
|
155
|
+
`minimumReleaseAgeExclude`, then remove it after the normal window.
|
|
156
|
+
- unsure about syntax: run `buildchain <path> --help`. Help is intercepted
|
|
157
|
+
before command dispatch and is side-effect free at every governed path.
|
|
158
|
+
|
|
159
|
+
## Small glossary
|
|
160
|
+
|
|
161
|
+
- **project type**: the repository shape selected by `buildchain init`.
|
|
162
|
+
- **lifecycle**: repository-owned install, build, verify, and publish commands.
|
|
163
|
+
- **reusable workflow**: Buildchain-owned GitHub Actions control plane called by
|
|
164
|
+
a thin consumer workflow.
|
|
165
|
+
- **Release Passport**: source- and artifact-bound release evidence, not a
|
|
166
|
+
release trigger.
|
|
167
|
+
- **train ref**: a temporary validation runtime; never a production dependency.
|
package/docs/install.md
CHANGED
|
@@ -72,18 +72,17 @@ age policy blocks the install, use a temporary package/version-specific
|
|
|
72
72
|
`minimumReleaseAgeExclude` entry instead of weakening the registry policy for
|
|
73
73
|
all packages:
|
|
74
74
|
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
"minimumReleaseAgeExclude": [
|
|
79
|
-
"@kungfu-tech/buildchain@3.0.0"
|
|
80
|
-
]
|
|
81
|
-
}
|
|
82
|
-
}
|
|
75
|
+
```yaml
|
|
76
|
+
minimumReleaseAgeExclude:
|
|
77
|
+
- '@kungfu-tech/buildchain@3.0.0'
|
|
83
78
|
```
|
|
84
79
|
|
|
85
80
|
Remove that entry after the package is old enough for the repository's normal
|
|
86
81
|
policy. Do not use a broad exclude such as `@kungfu-tech/*` for this case.
|
|
82
|
+
Buildchain-managed Paper scaffold and migration commands maintain this exact
|
|
83
|
+
version entry in `pnpm-workspace.yaml` so an immediately published, verified
|
|
84
|
+
runtime can refresh the lockfile without weakening the policy for other
|
|
85
|
+
packages.
|
|
87
86
|
|
|
88
87
|
## Repository Integration
|
|
89
88
|
|