BM3 (sdk): an install is a StepAsk of the kind install, dispatched by RunAsk

node-build-node accepts install as a StepAsk holding an install job (the
InstallAsk's fields and the module's fingerprint) under the version its
archive is published with; install is its own queue on that seat alone and
its holder pulls it. RunAsk dispatches the kind to the module's install body,
which publishes the archive <module>:node-modules to the artifact store, and
the install's end names the reference it answered.

Builds: design 47 H2 §800; H-A-367 (4), H-A-379, H-A-399 (1) (2), H-A-403
This commit is contained in:
2026-11-22 01:00:22 +01:00
parent 592637e6d7
commit b00cf73d77
19 changed files with 274 additions and 69 deletions
@@ -23,7 +23,7 @@ const FormBuildStep = 2
// whose fields changed while its forms did not (design 47 H2 §780).
const (
generatedForms = "1 build-step:2"
generatedFieldsDigest = "AskArtifact=35eb85c27e97 AskTaken=8c917075eed4 AskTakenEvent=e4fc9b81e066 BuiltArtifact=b5fcef7a8b58 BuiltArtifactResolvedItem=3bcbbcfd1a1f Capacity=b40cca7ccdfa CheckAccept=ef89c6962ae4 CheckStepAccept=ef89c6962ae4 CurrentAnswer=e39824e012cb CurrentAsk=ac167e5ee11f DeliveryAccept=ef89c6962ae4 DeliveryStepAccept=ef89c6962ae4 DetectedStep=a6fcd7d0eca4 DetectedSteps=05198185c776 DetectedStepsByModuleArtifactValue=cb35b5775cc6 Drop=fb4637978e86 DropAnswer=7538f2f5e68e FailingTest=f3fb3f1a3ca8 Fetch=6e12677bbc2c FetchAnswer=46fc3d5bd7ee FetchBesideItem=774b4bf88ba4 FetchBuildsItem=aee5adc97246 FetchPackage=20d1668a0eee FetchRefusal=de1518848b4c InstallAccept=6c42a0d3fe6d InstallAsk=7a855a79d290 KeptArtifactAnswer=706729f8ccb9 KeptResult=8657683cdcd7 LevelAnswer=143c69c28a6a LevelAnswerDigest=d54b7fd7b1da LevelAnswerDigestNeedsItem=946b37d1d4a1 LevelAnswerDigestPackagesItem=a7d30558470d LevelAnswerKeptItem=85d3c2f78632 LevelAnswerUnmetItem=946b37d1d4a1 ModuleTree=00bb59e9f262 NotRun=d322fb1eb153 OutputAnswer=97ba4bd92bf9 Pause=d6521e0cdd1e PauseAnswer=7538f2f5e68e PausesByCapacityNodeValue=5392cf505c80 PausesByDroppedIDValue=0e15ac9cacbd PausesByPausedNodeValue=d111aad0f0cf PlacedBeside=53479337ff18 Program=b48ae74f34e0 RecheckAccept=ef89c6962ae4 ResumeAnswer=7538f2f5e68e RunHead=774b4bf88ba4 RunInput=3dc41505a4b7 RunJob=88af2a7f432b RunProgram=6fd636999d54 Step=607e5f1a91cc StepAsk=9a8c9c8918b1 StepAskBuild=de784b6c05da StepAskCheck=b77941df6dea StepAskCompose=4c6a08e10231 StepEnded=a49b1cbd0c12 StepEndedEvent=207787118dac StepProgress=d25781cc895a StepProgressEvent=179344ce0ca2 StepResult=67f88be36d0e StepRun=a7a81f25515f StepsAnswer=2c02cac2df23 StepsByAskerNodeIDValue=50ccfd4cebd8 StepsByNodeIDValue=50ccfd4cebd8 TakenVersion=1b8d0547f61e TestCounts=9c1332427159 Toolchain=8ecb7debf9ad ToolchainReported=d26392767c50 ToolchainReportedEvent=fa0a431c9c7b ToolchainUsed=6cc7ccabc9f8 ToolchainsByNodeLanguageValue=f97d1dd27613"
generatedFieldsDigest = "AskArtifact=35eb85c27e97 AskTaken=8c917075eed4 AskTakenEvent=e4fc9b81e066 BuiltArtifact=b5fcef7a8b58 BuiltArtifactResolvedItem=3bcbbcfd1a1f Capacity=b40cca7ccdfa CheckAccept=ef89c6962ae4 CheckStepAccept=ef89c6962ae4 CurrentAnswer=e39824e012cb CurrentAsk=ac167e5ee11f DeliveryAccept=ef89c6962ae4 DeliveryStepAccept=ef89c6962ae4 DetectedStep=a6fcd7d0eca4 DetectedSteps=05198185c776 DetectedStepsByModuleArtifactValue=cb35b5775cc6 Drop=fb4637978e86 DropAnswer=7538f2f5e68e FailingTest=f3fb3f1a3ca8 Fetch=6e12677bbc2c FetchAnswer=46fc3d5bd7ee FetchBesideItem=774b4bf88ba4 FetchBuildsItem=aee5adc97246 FetchPackage=20d1668a0eee FetchRefusal=de1518848b4c InstallAccept=ef89c6962ae4 InstallAsk=9f965aa5b30b KeptArtifactAnswer=706729f8ccb9 KeptResult=8657683cdcd7 LevelAnswer=143c69c28a6a LevelAnswerDigest=d54b7fd7b1da LevelAnswerDigestNeedsItem=946b37d1d4a1 LevelAnswerDigestPackagesItem=a7d30558470d LevelAnswerKeptItem=85d3c2f78632 LevelAnswerUnmetItem=946b37d1d4a1 ModuleTree=00bb59e9f262 NotRun=d322fb1eb153 OutputAnswer=97ba4bd92bf9 Pause=d6521e0cdd1e PauseAnswer=7538f2f5e68e PausesByCapacityNodeValue=5392cf505c80 PausesByDroppedIDValue=0e15ac9cacbd PausesByPausedNodeValue=d111aad0f0cf PlacedBeside=53479337ff18 Program=b48ae74f34e0 RecheckAccept=ef89c6962ae4 ResumeAnswer=7538f2f5e68e RunHead=774b4bf88ba4 RunInput=3dc41505a4b7 RunJob=88af2a7f432b RunProgram=6fd636999d54 Step=607e5f1a91cc StepAsk=a22b1f717fc3 StepAskBuild=de784b6c05da StepAskCheck=b77941df6dea StepAskCompose=4c6a08e10231 StepEnded=a49b1cbd0c12 StepEndedEvent=207787118dac StepProgress=d25781cc895a StepProgressEvent=179344ce0ca2 StepResult=67f88be36d0e StepRun=a7a81f25515f StepsAnswer=2c02cac2df23 StepsByAskerNodeIDValue=50ccfd4cebd8 StepsByNodeIDValue=50ccfd4cebd8 TakenVersion=1b8d0547f61e TestCounts=9c1332427159 Toolchain=8ecb7debf9ad ToolchainReported=d26392767c50 ToolchainReportedEvent=fa0a431c9c7b ToolchainUsed=6cc7ccabc9f8 ToolchainsByNodeLanguageValue=f97d1dd27613"
)
const (
@@ -563,12 +563,14 @@ type FetchRefusal struct {
Reason string `json:"reason"`
}
// InstallAsk is an ask of the kind install (design 47 H2 §800, H-A-367 (4)): the npm tree a module's package lock names, installed with an integrity-checked install and no install scripts, kept as an archive in the holder's outputs under the lock's digest.
// InstallAsk is the job of an ask of the kind install (design 47 H2 §800, H-A-367 (4), H-A-403): the npm tree a module's package lock names, installed with an integrity-checked install and no install scripts, and published to the artifact store (the seat oci-artifact-registry) as the module's archive <module>:node-modules under the ask's version, which the builder's reservation covers.
type InstallAsk struct {
// who asked it
Asker string `json:"asker"`
// the commit the lock is read at
Commit string `json:"commit"`
// the module's build-input fingerprint at the commit
Fingerprint string `json:"fingerprint"`
// the ask's id
ID string `json:"id"`
// the package lock's text at the commit
@@ -802,7 +804,9 @@ type StepAsk struct {
Check *StepAskCheck `json:"check,omitempty"`
Compose *StepAskCompose `json:"compose,omitempty"`
ID string `json:"id"`
// build, check, compose or step
// the install job of the accepted kind install of node-build-node alone (design 47 H2 §800, H-A-403): the module's npm tree its lock names, published as the module's archive <module>:node-modules under the ask's version
Install *InstallAsk `json:"install,omitempty"`
// build, check, compose, step or install
Kind string `json:"kind"`
// go, typescript or image
Language string `json:"language"`
@@ -821,7 +825,7 @@ type StepAsk struct {
// StepEnded is an ask's end, said by the build seat's holder on the node that ran it, whatever its asker (design 47 G section 602): a pipeline step's end names the pipeline, the commit and the fingerprint it was asked at, which the runner takes only from that holder's account (ADR 0666 sections 7, 21); the end of any other ask names its asker, the ask, the node, the outcome and when, and neither commit nor fingerprint (design 47 G section 548).
type StepEnded struct {
// for an install, the name of the archive object in the holder's outputs that holds the installed tree (design 47 H2 §800)
// for an install, the reference the installed tree's archive was published under in the artifact store (the seat oci-artifact-registry; design 47 H2 §800, H-A-399 (2))
Archive string `json:"archive,omitempty"`
Artifact string `json:"artifact,omitempty"`
// the ask's id, by which a reader takes only its own asks
@@ -929,7 +933,7 @@ type StepResult struct {
// StepRun is one pipeline step of one artifact at one commit (ADR 0666 sections 7, 8, 17): the step a build seat runs in its sandbox from the change's own heads, the names the lint step needs and the kept results it may skip.
type StepRun struct {
// the install archive object the Go build module unpacks into the workspace before the step (design 47 H2 §800)
// the reference of the install archive in the artifact store, which the Go build module fetches and unpacks into the workspace before the step (design 47 H2 §800, H-A-399 (2))
Archive string `json:"archive,omitempty"`
// the artifact reference, <module>:<artifact>
Artifact string `json:"artifact"`
@@ -1185,7 +1189,7 @@ type DeliveryStepAccept = StepAsk
type RecheckAccept = StepAsk
// InstallAccept is the body of install.
type InstallAccept = InstallAsk
type InstallAccept = StepAsk
// StepEndedEvent is the body of the event step-ended.
type StepEndedEvent = StepEnded
@@ -89,7 +89,7 @@ func TestFixtures(t *testing.T) {
}, subjectIs: nil},
{name: "a check's step whose answer is kept as an object (G A-290)", subject: "", given: "{\"ended\":\"2026-11-05T10:05:00Z\",\"id\":\"c3d4e5f6a7b8c9\",\"node\":\"anchor\",\"output-object\":\"output.c3d4e5f6a7b8c9\",\"started\":\"2026-11-05T10:00:00Z\",\"state\":\"passed\",\"tool\":\"check\",\"v\":1}", wire: "{\"ended\":\"2026-11-05T10:05:00Z\",\"id\":\"c3d4e5f6a7b8c9\",\"node\":\"anchor\",\"output-object\":\"output.c3d4e5f6a7b8c9\",\"started\":\"2026-11-05T10:00:00Z\",\"state\":\"passed\",\"tool\":\"check\",\"v\":1}",
decode: func(b []byte) (any, error) { var v StepsByNodeIDValue; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
{name: "an install ask names the module's package lock at the commit", subject: "mesh.seat.node-build-node.accept.install", given: "{\"asker\":\"mesh-delivery-pipeline\",\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"id\":\"m2kx9a1b3c4d61\",\"lock\":\"{\\\"name\\\":\\\"mesh-forge\\\",\\\"lockfileVersion\\\":3,\\\"packages\\\":{}}\",\"module\":\"mesh-forge\",\"pipeline\":\"main.12.mesh-forge\"}", wire: "{\"asker\":\"mesh-delivery-pipeline\",\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"id\":\"m2kx9a1b3c4d61\",\"lock\":\"{\\\"name\\\":\\\"mesh-forge\\\",\\\"lockfileVersion\\\":3,\\\"packages\\\":{}}\",\"module\":\"mesh-forge\",\"pipeline\":\"main.12.mesh-forge\"}",
{name: "an install ask is a StepAsk of the kind install naming the module's package lock at the commit (H-A-403)", subject: "mesh.seat.node-build-node.accept.install", given: "{\"asker\":\"mesh-delivery-pipeline\",\"at\":\"2026-11-22T00:56:00Z\",\"id\":\"m2kx9a1b3c4d61\",\"install\":{\"asker\":\"mesh-delivery-pipeline\",\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-0123\",\"id\":\"m2kx9a1b3c4d61\",\"lock\":\"{\\\"name\\\":\\\"mesh-forge\\\",\\\"lockfileVersion\\\":3,\\\"packages\\\":{}}\",\"module\":\"mesh-forge\",\"pipeline\":\"main.12.mesh-forge\"},\"kind\":\"install\",\"language\":\"node\",\"v\":1,\"version\":\"0.1.4\"}", wire: "{\"asker\":\"mesh-delivery-pipeline\",\"at\":\"2026-11-22T00:56:00Z\",\"id\":\"m2kx9a1b3c4d61\",\"install\":{\"asker\":\"mesh-delivery-pipeline\",\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-0123\",\"id\":\"m2kx9a1b3c4d61\",\"lock\":\"{\\\"name\\\":\\\"mesh-forge\\\",\\\"lockfileVersion\\\":3,\\\"packages\\\":{}}\",\"module\":\"mesh-forge\",\"pipeline\":\"main.12.mesh-forge\"},\"kind\":\"install\",\"language\":\"node\",\"v\":1,\"version\":\"0.1.4\"}",
decode: func(b []byte) (any, error) { var v InstallAccept; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.node-build-node\\.accept\\.install$")},
{name: "drop names the ask and why", subject: "", given: "{\"by\":\"mesh-delivery-builder\",\"id\":\"a1b2\",\"why\":\"a newer fingerprint supersedes it\"}", wire: "{\"by\":\"mesh-delivery-builder\",\"id\":\"a1b2\",\"why\":\"a newer fingerprint supersedes it\"}",
decode: func(b []byte) (any, error) { var v DropInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},