@kungfu-tech/buildchain 3.0.6 → 3.0.7-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/actions/promote-buildchain-ref/README.md +10 -0
- package/actions/release-tail/README.md +17 -0
- package/bin/buildchain.mjs +11 -0
- package/bin/internal/command-registry.mjs +2 -0
- package/contracts/auditable-demo-scenario-v1.schema.json +1 -1
- package/contracts/engineering-housekeeper-v1.schema.json +143 -0
- package/contracts/fixtures/engineering-housekeeper-v1/cases.json +68 -0
- package/contracts/fixtures/release-tail-capabilities-v1/kungfu-alpha.json +273 -0
- package/contracts/publication-rehearsal-capsule-v1.schema.json +173 -0
- package/contracts/release-tail-capabilities-v1.schema.json +199 -0
- package/contracts/release-tail-provider-bindings-v1.schema.json +56 -0
- package/dist/site/agent-index.json +3 -0
- package/dist/site/artifact-schemas.json +6 -0
- package/dist/site/buildchain-contract.json +42 -27
- package/dist/site/buildchain-site.json +384 -33
- package/dist/site/capability-registry.json +15 -12
- package/dist/site/cli-registry.json +102 -0
- package/dist/site/controller-registry.json +19 -3
- package/dist/site/kfd-claims.json +359 -17
- package/dist/site/kfd-upstream-aggregate.json +1 -1
- package/dist/site/manual-registry.json +53 -7
- package/dist/site/node-api-registry.json +5882 -3605
- package/dist/site/page-registry.json +348 -21
- package/dist/site/public-surface-audit.json +396 -16
- package/dist/site/publication-authority-registry.json +106 -1
- package/dist/site/publication-registry.json +4 -4
- package/dist/site/release-provenance.json +7 -0
- package/dist/site/schemas/publication-rehearsal-capsule-v1.schema.json +269 -0
- package/dist/site/schemas/release-tail-capabilities-v1.schema.json +353 -0
- package/dist/site/schemas/release-tail-provider-bindings-v1.schema.json +94 -0
- package/dist/site/site-manifest.json +35 -11
- package/dist/site/workflow-registry.json +204 -10
- package/docs/MAP.md +6 -2
- package/docs/auditable-demo.md +2 -2
- package/docs/cli-reference.md +136 -0
- package/docs/dev-delivery-warrant.md +49 -4
- package/docs/engineering-housekeeper.md +138 -0
- package/docs/lifecycle-protocol.md +4 -2
- package/docs/node-api-reference.md +495 -281
- package/docs/publication-rehearsal.md +94 -0
- package/docs/release-governance.md +17 -2
- package/docs/release-tail-contract.md +160 -0
- package/docs/release-tail-provider-plane.md +120 -0
- package/docs/reusable-build-surface.md +11 -0
- package/package.json +11 -3
- package/packages/core/artifact-signing.js +61 -0
- package/packages/core/buildchain-agent-manuals.js +3 -0
- package/packages/core/buildchain-config.js +66 -6
- package/packages/core/buildchain-kfd-claims.js +1 -1
- package/packages/core/buildchain-publication-authority.js +5 -0
- package/packages/core/controller-evidence.js +2 -1
- package/packages/core/dev-delivery-warrant-cancellation.js +1 -0
- package/packages/core/dev-delivery-warrant-shadow.js +502 -0
- package/packages/core/dev-delivery-warrant.js +15 -6
- package/packages/core/diagnostics.js +8 -3
- package/packages/core/engineering-housekeeper-github-client.js +222 -0
- package/packages/core/engineering-housekeeper-github.js +501 -0
- package/packages/core/engineering-housekeeper.js +259 -0
- package/packages/core/index.js +42 -0
- package/packages/core/kfd-gate.js +45 -15
- package/packages/core/paper-agent-entry.js +11 -5
- package/packages/core/paper-repository.js +1 -0
- package/packages/core/paper-scaffold-content.js +21 -0
- package/packages/core/paper.js +28 -2
- package/packages/core/publication-rehearsal-projection.js +173 -0
- package/packages/core/publication-rehearsal-runtime.js +921 -0
- package/packages/core/release-passport.js +130 -20
- package/packages/core/release-tail-compatibility.js +60 -0
- package/packages/core/release-tail-provider-adapters.js +461 -0
- package/packages/core/release-tail-provider-plane.js +1228 -0
- package/scripts/assemble-publication-artifact-admission.mjs +1 -1
- package/scripts/assemble-self-publication-admission.mjs +2 -2
- package/scripts/audit-publication-control-plane.mjs +1 -1
- package/scripts/auditable-demo-bundle-verification.mjs +2 -3
- package/scripts/auditable-demo-platform.mjs +2 -2
- package/scripts/auditable-demo-renditions.mjs +1 -1
- package/scripts/auditable-demo.mjs +2 -2
- package/scripts/build-contract-core.mjs +8 -3
- package/scripts/build-standalone-binary.mjs +14 -3
- package/scripts/buildchain-cli-help.mjs +13 -0
- package/scripts/check-core-mechanism-inventory.mjs +347 -0
- package/scripts/check-inventory.mjs +10 -8
- package/scripts/check-maintainability.mjs +9 -2
- package/scripts/check-release-tail-contract.mjs +435 -0
- package/scripts/dev-delivery-warrant.mjs +31 -4
- package/scripts/dev-pr-auto-merge.mjs +30 -4
- package/scripts/dev-pr-delivery-warrant.mjs +50 -0
- package/scripts/engineering-housekeeper-workflow.mjs +394 -0
- package/scripts/generate-channel-promotion-workflow.mjs +10 -8
- package/scripts/generate-site-bundle.mjs +47 -4
- package/scripts/init-repo.mjs +26 -2
- package/scripts/inspect-artifact-signing-requests.mjs +6 -0
- package/scripts/materialize-self-release-candidate-version.mjs +137 -0
- package/scripts/publication-commit-evidence.mjs +69 -23
- package/scripts/release-candidate-resolver.mjs +16 -10
- package/scripts/release-tail.mjs +159 -0
- package/scripts/resume-from-candidate-run.mjs +123 -9
- package/scripts/seal-artifact-signing-requests.mjs +6 -0
- package/scripts/site-capability-metadata.mjs +13 -0
- package/scripts/v4-architecture.mjs +600 -0
- package/scripts/web-surface-core.mjs +8 -2
- package/scripts/workflow-call-contract.mjs +184 -5
|
@@ -0,0 +1,173 @@
|
|
|
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
|
+
|
|
8
|
+
export const PUBLICATION_REHEARSAL_AGENT_SECTION_START =
|
|
9
|
+
"<!-- buildchain:publication-rehearsal:v1:start -->";
|
|
10
|
+
export const PUBLICATION_REHEARSAL_AGENT_SECTION_END =
|
|
11
|
+
"<!-- buildchain:publication-rehearsal:v1:end -->";
|
|
12
|
+
export const PUBLICATION_REHEARSAL_WORKFLOW_PATH =
|
|
13
|
+
".github/workflows/publication-rehearsal.yml";
|
|
14
|
+
|
|
15
|
+
function tomlString(value) {
|
|
16
|
+
return JSON.stringify(value);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function publicationRehearsalToml() {
|
|
20
|
+
return `[publication_rehearsal]
|
|
21
|
+
contract = ${tomlString(PUBLICATION_REHEARSAL_CAPSULE_CONTRACT)}
|
|
22
|
+
adr = ${tomlString(RELEASE_LOCAL_CONSTRUCTIBILITY_ADR)}
|
|
23
|
+
invariant = ${tomlString(RELEASE_LOCAL_CONSTRUCTIBILITY_INVARIANT)}
|
|
24
|
+
command = ${tomlString(PUBLICATION_REHEARSAL_COMMAND)}
|
|
25
|
+
capsule = ".buildchain/publication/rehearsal-capsule.json"
|
|
26
|
+
capsule_root = ".buildchain/publication/candidate"
|
|
27
|
+
state = ".buildchain/publication/rehearsal-state.json"
|
|
28
|
+
evidence = ".buildchain/publication/rehearsal-evidence.json"
|
|
29
|
+
`;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function assertPublicationRehearsalConfig(config) {
|
|
33
|
+
const section = config?.publication_rehearsal;
|
|
34
|
+
if (!section || typeof section !== "object" || Array.isArray(section)) {
|
|
35
|
+
throw new Error("publication_rehearsal table is missing");
|
|
36
|
+
}
|
|
37
|
+
const expected = {
|
|
38
|
+
contract: PUBLICATION_REHEARSAL_CAPSULE_CONTRACT,
|
|
39
|
+
adr: RELEASE_LOCAL_CONSTRUCTIBILITY_ADR,
|
|
40
|
+
invariant: RELEASE_LOCAL_CONSTRUCTIBILITY_INVARIANT,
|
|
41
|
+
command: PUBLICATION_REHEARSAL_COMMAND,
|
|
42
|
+
capsule: ".buildchain/publication/rehearsal-capsule.json",
|
|
43
|
+
capsule_root: ".buildchain/publication/candidate",
|
|
44
|
+
state: ".buildchain/publication/rehearsal-state.json",
|
|
45
|
+
evidence: ".buildchain/publication/rehearsal-evidence.json",
|
|
46
|
+
};
|
|
47
|
+
const actualKeys = Object.keys(section).sort();
|
|
48
|
+
const expectedKeys = Object.keys(expected).sort();
|
|
49
|
+
if (actualKeys.join("\n") !== expectedKeys.join("\n")) {
|
|
50
|
+
throw new Error(
|
|
51
|
+
`publication_rehearsal fields must be exactly: ${expectedKeys.join(", ")}`,
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
for (const [key, value] of Object.entries(expected)) {
|
|
55
|
+
if (section[key] !== value) {
|
|
56
|
+
throw new Error(`publication_rehearsal.${key} is stale or unsupported`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return structuredClone(section);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function appendPublicationRehearsalToml(source) {
|
|
63
|
+
const current = String(source || "").trimEnd();
|
|
64
|
+
if (/^\[publication_rehearsal\]$/mu.test(current)) {
|
|
65
|
+
throw new Error(
|
|
66
|
+
"buildchain config already contains a publication_rehearsal table",
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
return `${current}\n\n${publicationRehearsalToml()}`;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function projectPublicationRehearsalToml(source) {
|
|
73
|
+
const current = String(source || "");
|
|
74
|
+
const start = current.search(/^\[publication_rehearsal\]\s*$/mu);
|
|
75
|
+
if (start === -1) return appendPublicationRehearsalToml(current);
|
|
76
|
+
const remainder = current.slice(start);
|
|
77
|
+
const nextTable = remainder
|
|
78
|
+
.slice(remainder.indexOf("\n") + 1)
|
|
79
|
+
.search(/^\[[^\n]+\]\s*$/mu);
|
|
80
|
+
const end =
|
|
81
|
+
nextTable === -1
|
|
82
|
+
? current.length
|
|
83
|
+
: start + remainder.indexOf("\n") + 1 + nextTable;
|
|
84
|
+
const prefix = current.slice(0, start).trimEnd();
|
|
85
|
+
const suffix = current.slice(end).trimStart();
|
|
86
|
+
return `${prefix}\n\n${publicationRehearsalToml()}${suffix ? `\n${suffix}` : ""}`;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export function publicationRehearsalAgentInstructions() {
|
|
90
|
+
return `${PUBLICATION_REHEARSAL_AGENT_SECTION_START}
|
|
91
|
+
## Publication rehearsal (required)
|
|
92
|
+
|
|
93
|
+
Buildchain release behavior follows
|
|
94
|
+
\`${RELEASE_LOCAL_CONSTRUCTIBILITY_ADR}\`. ${RELEASE_LOCAL_CONSTRUCTIBILITY_INVARIANT}
|
|
95
|
+
|
|
96
|
+
Before hosted publication, restore the explicit
|
|
97
|
+
\`${PUBLICATION_REHEARSAL_CAPSULE_CONTRACT}\` capsule and run exactly:
|
|
98
|
+
|
|
99
|
+
\`\`\`sh
|
|
100
|
+
${PUBLICATION_REHEARSAL_COMMAND}
|
|
101
|
+
\`\`\`
|
|
102
|
+
|
|
103
|
+
Simulation and replay evidence never claim external publication truth. GitHub
|
|
104
|
+
Actions may add only declared credentials, transport, and unavoidable provider
|
|
105
|
+
effects; it may not add semantic inputs from runner environment or workspace.
|
|
106
|
+
${PUBLICATION_REHEARSAL_AGENT_SECTION_END}`;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export function mergePublicationRehearsalAgentInstructions(current = "") {
|
|
110
|
+
const source = String(current || "");
|
|
111
|
+
const section = publicationRehearsalAgentInstructions();
|
|
112
|
+
const start = source.indexOf(PUBLICATION_REHEARSAL_AGENT_SECTION_START);
|
|
113
|
+
const end = source.indexOf(PUBLICATION_REHEARSAL_AGENT_SECTION_END);
|
|
114
|
+
if ((start === -1) !== (end === -1)) {
|
|
115
|
+
throw new Error(
|
|
116
|
+
"AGENTS.md has an incomplete Buildchain publication rehearsal section",
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
if (start === -1) {
|
|
120
|
+
return source.trim()
|
|
121
|
+
? `${source.trimEnd()}\n\n${section}\n`
|
|
122
|
+
: `# AGENTS.md\n\n${section}\n`;
|
|
123
|
+
}
|
|
124
|
+
if (
|
|
125
|
+
source.indexOf(PUBLICATION_REHEARSAL_AGENT_SECTION_START, start + 1) !==
|
|
126
|
+
-1 ||
|
|
127
|
+
source.indexOf(PUBLICATION_REHEARSAL_AGENT_SECTION_END, end + 1) !== -1 ||
|
|
128
|
+
end < start
|
|
129
|
+
) {
|
|
130
|
+
throw new Error(
|
|
131
|
+
"AGENTS.md has ambiguous Buildchain publication rehearsal sections",
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
return `${source.slice(0, start)}${section}${source.slice(
|
|
135
|
+
end + PUBLICATION_REHEARSAL_AGENT_SECTION_END.length,
|
|
136
|
+
)}`;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export function publicationRehearsalWorkflow(buildchainRef) {
|
|
140
|
+
const ref = String(buildchainRef || "").trim();
|
|
141
|
+
if (!ref)
|
|
142
|
+
throw new Error("publication rehearsal workflow requires a Buildchain ref");
|
|
143
|
+
return `name: Publication Rehearsal
|
|
144
|
+
|
|
145
|
+
on:
|
|
146
|
+
workflow_dispatch:
|
|
147
|
+
inputs:
|
|
148
|
+
capsule-path:
|
|
149
|
+
description: "Content-addressed publication rehearsal capsule"
|
|
150
|
+
required: true
|
|
151
|
+
default: ".buildchain/publication/rehearsal-capsule.json"
|
|
152
|
+
capsule-root:
|
|
153
|
+
description: "Repository-relative capsule file root"
|
|
154
|
+
required: true
|
|
155
|
+
default: ".buildchain/publication/candidate"
|
|
156
|
+
|
|
157
|
+
permissions:
|
|
158
|
+
contents: write
|
|
159
|
+
|
|
160
|
+
jobs:
|
|
161
|
+
rehearsal:
|
|
162
|
+
uses: kungfu-systems/buildchain/.github/workflows/release-tail.yml@${ref}
|
|
163
|
+
with:
|
|
164
|
+
buildchain-ref: ${ref}
|
|
165
|
+
capsule-contract: ${JSON.stringify(PUBLICATION_REHEARSAL_CAPSULE_CONTRACT)}
|
|
166
|
+
capsule-path: \${{ inputs.capsule-path }}
|
|
167
|
+
capsule-root: \${{ inputs.capsule-root }}
|
|
168
|
+
state-path: ".buildchain/publication/rehearsal-state.json"
|
|
169
|
+
evidence-path: ".buildchain/publication/rehearsal-evidence.json"
|
|
170
|
+
secrets:
|
|
171
|
+
http-token: \${{ secrets.BUILDCHAIN_PUBLICATION_HTTP_TOKEN }}
|
|
172
|
+
`;
|
|
173
|
+
}
|