feat(builder): govern OS-image builds through the capability membrane (closure #1) - #557
Merged
Merged
Conversation
|
|
||
| const cli = (name, body) => { | ||
| const p = path.join(os.tmpdir(), name); | ||
| fs.writeFileSync(p, `let d='';process.stdin.on('data',c=>d+=c);process.stdin.on('end',()=>{${body}});`); |
mdheller
enabled auto-merge (squash)
August 4, 2026 17:10
… (closure #1) The image-build path was self-governed by sourceos-spec contracts but never passed through the estate's autonomy-governance fabric — a build could dispatch with no membrane decision on record. This admits every build through the AUTHORITATIVE capability membrane before dispatch and seals the decision into an AutonomyAdmissionReceipt (the same contract the membrane emits estate-wide). - src/services/buildAdmission.ts — composes a membrane CapabilityRequest for the build (surface=sourceos.os-image-build, tier→autonomy level, spec→risk), CALLS the authoritative membrane (never reinvents the decision) over a config-driven transport (MEMBRANE_GATE_URL http / MEMBRANE_GATE_CMD cli: JSON in, decision out, exit 0=allow /3=deny), and seals an AutonomyAdmissionReceipt.v0.2. Two safety properties: * ADVISORY BY DEFAULT — every build gets a decision + sealed receipt but is never blocked unless BUILD_ADMISSION_ENFORCE=true, so wiring this cannot break the live pipeline. Flip enforcement on once the membrane transport is confirmed in deploy. * FAIL-CLOSED WHEN ENFORCING — an unreachable/unwired membrane denies; never opens. - routes/api/builds-route.ts — admit before dispatchBuild: validate the receipt against the vendored schema (our own receipt must conform), persist it + emit srcos.builder.admission.decided, and on an enforced deny return 403 without dispatch. - contracts/schemas/AutonomyAdmissionReceipt.v0.2.json — vendored verbatim + hash-pinned from prophet-platform (authoritative), registered in the contracts validator. - test/admission.test.mjs — advisory-admits / enforce-fails-closed / cli allow+deny / advisory-records-deny-without-blocking / risk classification / receipt conformance + seal. Gated in builder-contract-tests.yml. Existing contract test stays green. Follow-up (deploy): set MEMBRANE_GATE_URL|CMD in the builder env, confirm decisions, then set BUILD_ADMISSION_ENFORCE=true to make governance binding. Closure #2 (point ControlPlaneLifecycle.vue at live evidence bundles) is separate.
mdheller
force-pushed
the
feat/governed-build-admission
branch
from
August 4, 2026 18:04
4baa3b0 to
a593695
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes the biggest governance gap the OS-build survey found: the image-build path is self-governed by
sourceos-speccontracts but never passes through the estate's autonomy-governance fabric — a build could dispatch with no membrane decision on record. This admits every build through the authoritative capability membrane before dispatch and seals the decision into anAutonomyAdmissionReceipt(the same contract the membrane emits estate-wide).Safe to land on a live pipeline
BUILD_ADMISSION_ENFORCE=true. So wiring this cannot break the currently-shipped build loop. Flip enforcement on once the membrane transport is confirmed in the deploy.prophet-platform.Changes
src/services/buildAdmission.ts— compose a membraneCapabilityRequest(surfacesourceos.os-image-build, tier→autonomy level, spec→risk), call the authoritative membrane over a config-driven transport (MEMBRANE_GATE_URLHTTP /MEMBRANE_GATE_CMDCLI: JSON in, decision out, exit 0=allow/3=deny), seal anAutonomyAdmissionReceipt.v0.2.routes/api/builds-route.ts— admit beforedispatchBuild: validate the receipt against the vendored schema, persist it + emitsrcos.builder.admission.decided, and on an enforced deny return403without dispatching.contracts/schemas/AutonomyAdmissionReceipt.v0.2.json(+ PROVENANCE) — vendored from prophet-platform, registered in the contracts validator.test/admission.test.mjs— advisory-admits / enforce-fails-closed / CLI allow+deny / advisory-records-deny-without-blocking / risk / receipt conformance + seal. Gated inbuilder-contract-tests.yml. Existing contract test stays green.Follow-ups
MEMBRANE_GATE_URL|CMDin the builder env, confirm decisions, thenBUILD_ADMISSION_ENFORCE=trueto make governance binding.ControlPlaneLifecycle.vue's evidence-gate view at the live GCS-emitted evidence bundles instead of fixtures.Touches a workflow — flagged for human review; not auto-merging.