Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@
{ "type": "toml", "path": "Cargo.toml", "jsonpath": "$.workspace.package.version" },
{ "type": "toml", "path": "Cargo.toml", "jsonpath": "$.workspace.dependencies.repo-model.version" },
{ "type": "toml", "path": "Cargo.toml", "jsonpath": "$.workspace.dependencies.repo-conformance.version" },
{ "type": "toml", "path": "Cargo.toml", "jsonpath": "$.workspace.dependencies.prismpm.version" }
{ "type": "toml", "path": "Cargo.toml", "jsonpath": "$.workspace.dependencies.prismpm.version" },
{ "type": "generic", "path": "sdk/generate-inventory.mjs" },
{ "type": "generic", "path": "sdk/Dockerfile" },
{ "type": "json", "path": "sdk/oracles/package.json", "jsonpath": "$.version" },
{ "type": "json", "path": "sdk/runtime/package.json", "jsonpath": "$.version" }
]
},
"sdk/npm/prism-code": { "release-type": "node", "component": "prism-code", "extra-files": [{ "type": "generic", "path": "src/version.mjs" }] },
Expand Down
4 changes: 3 additions & 1 deletion scripts/library-sdk-check-shell.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import {test} from 'node:test';
import {capture} from './library-sdk-check.mjs';
import {lockFixture,resultFixture,qualificationFixture} from './library-sdk-fixture.mjs';
import {historicalLock,migrationChecks,expectedMigrationProcesses} from '../sdk/migration-qualification.mjs';
// The workspace version the image label carries (scripts/workspace-version.mjs).
const workspaceVersion=()=>/^version = "([^"]+)"$/m.exec(readFileSync(new URL('../Cargo.toml',import.meta.url),'utf8').split('[workspace.package]')[1])[1];

const source=resolve(dirname(fileURLToPath(import.meta.url)),'..');
const sourceAuthority={archive_sha256:createHash('sha256').update(readFileSync(join(source,'vendor/lean4-prod/lean.tar'))).digest('hex'),toolchain:readFileSync(join(source,'lean-toolchain'),'utf8').trim()};
Expand All @@ -22,7 +24,7 @@ const earlier=fs.existsSync(log)?fs.readFileSync(log,'utf8').trim().split('\\n')
fs.appendFileSync(log,JSON.stringify(args)+'\\n');
const id='c'.repeat(64);
if(args[0]==='pull')process.exit(0);
if(args[0]==='image'&&args[1]==='inspect'){console.log(JSON.stringify([{Os:'linux',Architecture:process.arch==='x64'?'amd64':'arm64',RepoDigests:[process.env.RECORDED_IMAGE],Config:{Entrypoint:['/usr/local/bin/prismpm-devcontainer-init'],Volumes:null,Labels:{'org.opencontainers.image.revision':process.env.RECORDED_REVISION,'org.opencontainers.image.source':'https://github.com/UOR-Foundation/PrismPM','org.opencontainers.image.version':'0.4.0'}}}]));process.exit(0);}
if(args[0]==='image'&&args[1]==='inspect'){console.log(JSON.stringify([{Os:'linux',Architecture:process.arch==='x64'?'amd64':'arm64',RepoDigests:[process.env.RECORDED_IMAGE],Config:{Entrypoint:['/usr/local/bin/prismpm-devcontainer-init'],Volumes:null,Labels:{'org.opencontainers.image.revision':process.env.RECORDED_REVISION,'org.opencontainers.image.source':'https://github.com/UOR-Foundation/PrismPM','org.opencontainers.image.version':'${workspaceVersion()}'}}}]));process.exit(0);}
if(args[0]==='container'&&args[1]==='create'){console.log(id);process.exit(0);}
if(args[0]==='container'&&args[1]==='cp'){
const from=args[2].split(':').slice(1).join(':'),prefix='/opt/prismpm/share/conformance-root/';
Expand Down
4 changes: 3 additions & 1 deletion scripts/library-sdk-check.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import {dirname,join,resolve} from 'node:path';
import {test} from 'node:test';
import {capture,verifySource,sourceRoots,sourceAliases,cli,readHistoricalLibraryEvidence,checkAccepted as checkAcceptedWithAuthority,mutateModule,tree,verifyImage,verifyResult,testOutput,validateCapturedLock} from './library-sdk-check.mjs';
import {lockFixture,resultFixture,sourceAuthorityFixture} from './library-sdk-fixture.mjs';
// The workspace version the image label carries (scripts/workspace-version.mjs).
const workspaceVersion=()=>/^version = "([^"]+)"$/m.exec(readFileSync(new URL('../Cargo.toml',import.meta.url),'utf8').split('[workspace.package]')[1])[1];
const checkAccepted=(project,receipt)=>readHistoricalLibraryEvidence(project,receipt,'3'.repeat(64));

const revision='a'.repeat(40),image='ghcr.io/uor-foundation/prismpm-sdk@sha256:'+'b'.repeat(64);
Expand Down Expand Up @@ -51,7 +53,7 @@ test('only the exact reviewed source aliases and their canonical target bytes ar
});

test('the immutable installed image must identify the exact current native source',()=>{
const base=[{Os:'linux',Architecture:'amd64',RepoDigests:[image],Config:{Entrypoint:['/usr/local/bin/prismpm-devcontainer-init'],Volumes:null,Labels:{'org.opencontainers.image.revision':revision,'org.opencontainers.image.source':'https://github.com/UOR-Foundation/PrismPM','org.opencontainers.image.version':'0.4.0'}}}];
const base=[{Os:'linux',Architecture:'amd64',RepoDigests:[image],Config:{Entrypoint:['/usr/local/bin/prismpm-devcontainer-init'],Volumes:null,Labels:{'org.opencontainers.image.revision':revision,'org.opencontainers.image.source':'https://github.com/UOR-Foundation/PrismPM','org.opencontainers.image.version':workspaceVersion()}}}];
verifyImage(base,image,'amd64',revision);
for(const change of [v=>v[0].Architecture='arm64',v=>v[0].Config.Labels['org.opencontainers.image.revision']='c'.repeat(40),v=>v[0].RepoDigests=[],v=>v[0].Config.Volumes={'/opt/prismpm':{}}]){const bad=structuredClone(base);change(bad);assert.throws(()=>verifyImage(bad,image,'amd64',revision));}
assert.throws(()=>verifyImage(base,'ghcr.io/uor-foundation/prismpm-sdk:latest','amd64',revision));
Expand Down
4 changes: 3 additions & 1 deletion scripts/release-gate-evidence.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {fileURLToPath, pathToFileURL} from 'node:url';
import {bootstrapNames, canonical, captureBootstrap, hash, readOriginal, validateBootstrapBytes} from './sdk-bootstrap-retention.mjs';
import {assembleVvEvidence, validateVvPart, vvParts} from './sdk-vv-run.mjs';
import {isAncestor, kappa} from './factory.mjs';
import {workspaceVersion} from './workspace-version.mjs';

export function releaseContext(revision, architecture, image, runId, attempt) {
assert.match(revision, /^[0-9a-f]{40}$/); assert(['amd64', 'arm64'].includes(architecture));
Expand Down Expand Up @@ -218,7 +219,8 @@ export function validateNative(files, context) {
assert.equal(result.schema, 'prismpm/native-equivalence-retention/1'); assert.equal(result.scope, 'original-native-sdk-comparison-only');
assert.equal(resolve(result.root), result.root); assert(!result.root.includes(','));
assert.deepEqual(Object.keys(result.archive).sort(), ['byte_length', 'path', 'sha256']);
assert.match(result.archive.path, /^prismpm-0\.4\.0-(?:aarch64|x86_64)-unknown-linux-gnu\.tar\.gz$/);
const version = workspaceVersion().replaceAll('.', '\\.');
assert.match(result.archive.path, new RegExp(`^prismpm-${version}-(?:aarch64|x86_64)-unknown-linux-gnu\\.tar\\.gz$`));
assert.equal(result.archive.path.includes('aarch64'), context.architecture === 'arm64');
assert(Number.isSafeInteger(result.archive.byte_length) && result.archive.byte_length > 0);
assert.match(result.archive.sha256, /^[0-9a-f]{64}$/);
Expand Down
5 changes: 3 additions & 2 deletions scripts/release-gate-evidence.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {bootstrapNames, canonical, hash, readOriginal, validateBootstrapRetentio
import {assembleSourceEvidence, captureCommand, nativeInvocations, releaseContext, sourceEvidenceNames, validateCommand, validateSourcePart, validateSourceReceipt} from './release-gate-evidence.mjs';
import {captureEvidence, packEvidence} from './sdk-release-evidence.mjs';
import {retainPart, vvParts} from './sdk-vv-run.mjs';
import {workspaceVersion} from './workspace-version.mjs';
const require = createRequire('/opt/prismpm/oracles/package.json'), {load} = require('js-yaml');
const revision = 'a'.repeat(40), image = 'ghcr.io/uor-foundation/prismpm-sdk@sha256:' + 'b'.repeat(64);
const context = releaseContext(revision, 'amd64', image, '123', '1');
Expand Down Expand Up @@ -48,7 +49,7 @@ function nativeFixture(root) {
const source = '/unit-only/source';
for (const [prefix, args, status] of nativeInvocations(source, image, 'amd64', 1000, 1000)) commandFixture(root, prefix, 'docker', args, status);
put(root, 'native-result.json', {schema: 'prismpm/native-equivalence-retention/1', scope: 'original-native-sdk-comparison-only',
...context, root: source, uid: 1000, gid: 1000, archive: descriptor('prismpm-0.4.0-x86_64-unknown-linux-gnu.tar.gz', Buffer.from('fixture archive'))});
...context, root: source, uid: 1000, gid: 1000, archive: descriptor(`prismpm-${workspaceVersion()}-x86_64-unknown-linux-gnu.tar.gz`, Buffer.from('fixture archive'))});
}

test('native and container mutable references use the PP6101 exit class', () => {
Expand Down Expand Up @@ -400,7 +401,7 @@ test('missing bootstrap, failed command, substituted bytes and wrong native invo
root => {const row = JSON.parse(readFileSync(join(root, 'native-error.json'))); row.status = 6; put(root, 'native-error.json', row);},
root => commandFixture(root, 'container-error', 'docker', ['run', 'changed'], 6),
root => {const row = JSON.parse(readFileSync(join(root, 'native-error.json'))); row.status = 0; put(root, 'native-error.json', row);},
root => {const row = JSON.parse(readFileSync(join(root, 'native-result.json'))); row.archive.path = 'prismpm-0.4.0-aarch64-unknown-linux-gnu.tar.gz'; put(root, 'native-result.json', row);},
root => {const row = JSON.parse(readFileSync(join(root, 'native-result.json'))); row.archive.path = `prismpm-${workspaceVersion()}-aarch64-unknown-linux-gnu.tar.gz`; put(root, 'native-result.json', row);},
root => {const row = JSON.parse(readFileSync(join(root, 'container-check.json'))); commandFixture(root, 'container-check', row.command, row.arguments, 0, 'different success');},
]],
]) for (const mutate of changes) {
Expand Down
4 changes: 3 additions & 1 deletion scripts/sdk-construction-handoff.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import {createHash} from 'node:crypto';
import test from 'node:test';
import {readFileSync} from 'node:fs';
import {validateConstructionAuthority,validateConstructionMetadata,composeConstructionIndex} from './sdk-construction-handoff.mjs';
// The workspace version the image label carries (scripts/workspace-version.mjs).
const workspaceVersion=()=>/^version = "([^"]+)"$/m.exec(readFileSync(new URL('../Cargo.toml',import.meta.url),'utf8').split('[workspace.package]')[1])[1];
const sha=b=>'sha256:'+createHash('sha256').update(b).digest('hex');
const bytes=v=>Buffer.from(JSON.stringify(v));
const now=Date.parse('2026-10-08T00:00:00Z');
Expand Down Expand Up @@ -38,7 +40,7 @@ function fixture(runId=123,attempt=1){
const standards=bytes({schema:'prismpm/standards-lock/1',authorities:[],oracles:[]});
function lane(arch){
const config=bytes({os:'linux',architecture:arch,config:{Labels:{'org.opencontainers.image.revision':source,
'org.opencontainers.image.source':'https://github.com/UOR-Foundation/PrismPM','org.opencontainers.image.version':'0.4.0',
'org.opencontainers.image.source':'https://github.com/UOR-Foundation/PrismPM','org.opencontainers.image.version':workspaceVersion(),
'org.opencontainers.image.created':'1970-01-01T00:00:00Z'}}});
const manifest=bytes({schemaVersion:2,mediaType:'application/vnd.oci.image.manifest.v1+json',
config:{mediaType:'application/vnd.oci.image.config.v1+json',digest:sha(config),size:config.length},layers:[{
Expand Down
4 changes: 3 additions & 1 deletion scripts/sdk-construction-record.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import {tmpdir} from 'node:os';
import {pathToFileURL} from 'node:url';
import test from 'node:test';
import {constructionRecord} from './sdk-construction-record.mjs';
// The workspace version the image label carries (scripts/workspace-version.mjs).
const workspaceVersion=()=>/^version = "([^"]+)"$/m.exec(readFileSync(new URL('../Cargo.toml',import.meta.url),'utf8').split('[workspace.package]')[1])[1];
const sha=b=>'sha256:'+createHash('sha256').update(b).digest('hex');

function fixture(t){
Expand All @@ -24,7 +26,7 @@ function fixture(t){
const layer=execFileSync('/usr/bin/tar',['--format=ustar','-cf','-','-C',layerRoot,'unit-only'],{timeout:5000,maxBuffer:1048576});
const config=Buffer.from(JSON.stringify({os:'linux',architecture:arch,rootfs:{type:'layers',diff_ids:[sha(layer)]},config:{Labels:{
'org.opencontainers.image.revision':source,'org.opencontainers.image.source':'https://github.com/UOR-Foundation/PrismPM',
'org.opencontainers.image.version':'0.4.0','org.opencontainers.image.created':'1970-01-01T00:00:00Z'}}}));
'org.opencontainers.image.version':workspaceVersion(),'org.opencontainers.image.created':'1970-01-01T00:00:00Z'}}}));
const manifest=Buffer.from(JSON.stringify({schemaVersion:2,mediaType:'application/vnd.oci.image.manifest.v1+json',
config:{...put(config),mediaType:'application/vnd.oci.image.config.v1+json'},
layers:[{...put(layer),mediaType:'application/vnd.oci.image.layer.v1.tar'}]}));
Expand Down
4 changes: 3 additions & 1 deletion scripts/unpublished-sdk-registry.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import {tarEntry,storedZip} from './sdk-construction-archive-fixture.mjs';
import {stageConstructionArchiveStream,consumeConstructionOciStage} from './sdk-construction-archive.mjs';
import {retireConstructionStage} from './sdk-construction-stage.mjs';
import {createUnpublishedRegistry,importUnpublishedStage,publishUnpublishedIndex,closeUnpublishedRegistry} from './unpublished-sdk-registry.mjs';
// The workspace version the image label carries (scripts/workspace-version.mjs).
const workspaceVersion=()=>/^version = "([^"]+)"$/m.exec(readFileSync(new URL('../Cargo.toml',import.meta.url),'utf8').split('[workspace.package]')[1])[1];
const sha=b=>'sha256:'+createHash('sha256').update(b).digest('hex');
const json=v=>Buffer.from(JSON.stringify(v));
const revision='1'.repeat(40),imageType='application/vnd.oci.image.manifest.v1+json';
Expand All @@ -23,7 +25,7 @@ function fixture(arch='amd64',wrongDiff=false,codec='gzip',damage){
if(damage==='truncated')layer=layer.subarray(0,Math.floor(layer.length/2));
else if(damage==='corrupt'){layer=Buffer.from(layer);layer[0]^=0xff;}
else assert.equal(damage,undefined);
const config=json({architecture:arch,os:'linux',config:{Labels:{'org.opencontainers.image.revision':revision,'org.opencontainers.image.source':'https://github.com/UOR-Foundation/PrismPM','org.opencontainers.image.version':'0.4.0','org.opencontainers.image.created':'1970-01-01T00:00:00Z'}},rootfs:{type:'layers',diff_ids:[wrongDiff?'sha256:'+'0'.repeat(64):sha(expanded)]}});
const config=json({architecture:arch,os:'linux',config:{Labels:{'org.opencontainers.image.revision':revision,'org.opencontainers.image.source':'https://github.com/UOR-Foundation/PrismPM','org.opencontainers.image.version':workspaceVersion(),'org.opencontainers.image.created':'1970-01-01T00:00:00Z'}},rootfs:{type:'layers',diff_ids:[wrongDiff?'sha256:'+'0'.repeat(64):sha(expanded)]}});
const manifest=json({schemaVersion:2,mediaType:imageType,config:{mediaType:'application/vnd.oci.image.config.v1+json',digest:sha(config),size:config.length},layers:[{mediaType:'application/vnd.oci.image.layer.v1.tar'+(codec==='tar'?'':'+'+codec),digest:sha(layer),size:layer.length}]});
const child={mediaType:imageType,digest:sha(manifest),size:manifest.length,platform:{os:'linux',architecture:arch}};
const blobs=[layer,config,manifest];
Expand Down
4 changes: 3 additions & 1 deletion sdk/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,9 @@ RUN /usr/bin/python3 -I -B scripts/normalize-cargo-git.py /usr/local/cargo \
&& rm -f /usr/local/cargo/.global-cache /usr/local/cargo/.global-cache-journal /usr/local/cargo/.global-cache-wal /usr/local/cargo/.global-cache-shm

FROM build AS cli-archive-package
ARG SDK_VERSION=0.4.0
# x-release-please-start-version
ARG SDK_VERSION=0.5.0
# x-release-please-end
ARG TARGETARCH
COPY --from=source_inputs /prepared/source/LICENSE-APACHE /prepared/source/LICENSE-MIT /prepared/source/README.md /tmp/native-licenses/
RUN set -eu; \
Expand Down
10 changes: 5 additions & 5 deletions sdk/generate-inventory.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const definitions = [
['sdk-metadata-credentials', 'schema', '1', '/opt/prismpm/metadata-credentials.mjs'],
['sdk-metadata-helper', 'schema', '1', '/opt/prismpm/metadata-helper.mjs'],
['sdk-metadata-helper-supervisor', 'schema', '1', '/opt/prismpm/metadata-helper-supervisor.py'],
['action', 'workflow', '0.4.0', 'action', 'tree'],
['action', 'workflow', '0.5.0', 'action', 'tree'], // x-release-please-version
['adapter-compose', 'adapter', 'compose-spec@fee041b381ffd4aad263410980bdce0cdf4beb7d', 'adapters/compose.json'],
['adapter-github-pages', 'adapter', 'github-pages-artifact@v4', 'adapters/github-pages.json'],
['adapter-github-pages-browser', 'adapter', 'github-pages-artifact@v4', 'adapters/github-pages-browser.json'],
Expand Down Expand Up @@ -117,9 +117,9 @@ const definitions = [
['playwright-chromium', 'oracle', '1.62.1', null, 'sha256:dcc5531e97840b9b5e794f2814476b21571c5124a3fca2267d73041f56e7580e'],
['playwright-driver', 'oracle', '1.62.1', '/opt/prismpm/oracles/node_modules/playwright', 'tree'],
['playwright-core', 'oracle', '1.62.1', '/opt/prismpm/oracles/node_modules/playwright-core', 'tree'],
['prismpm', 'binary', '0.4.0', '/usr/local/bin/prismpm'],
['prismpm-conformance', 'binary', '0.4.0', '/usr/local/bin/prismpm-conformance'],
['prismpm-platform-equivalence', 'binary', '0.4.0', '/usr/local/bin/prismpm-platform-equivalence'],
['prismpm', 'binary', '0.5.0', '/usr/local/bin/prismpm'], // x-release-please-version
['prismpm-conformance', 'binary', '0.5.0', '/usr/local/bin/prismpm-conformance'], // x-release-please-version
['prismpm-platform-equivalence', 'binary', '0.5.0', '/usr/local/bin/prismpm-platform-equivalence'], // x-release-please-version
['prism-stdlib', 'crate', '0.2.0', 'stdlib/generated/prism-stdlib-0.2.0.crate'],
['runtime-base', 'base-image', 'playwright-v1.62.1-noble', null, 'sha256:dcc5531e97840b9b5e794f2814476b21571c5124a3fca2267d73041f56e7580e'],
['runtime-os-lock', 'dependency-lock', 'ubuntu-noble@20260901T000000Z', 'sdk/runtime-os.lock'],
Expand All @@ -133,7 +133,7 @@ const definitions = [
['timeout', 'binary', 'coreutils-9.4', '/usr/bin/timeout'],
['unicode-17.0.0-normalization-corpus', 'test-corpus', '17.0.0', 'standards/corpora/unicode-17.0.0', 'tree'],
['opentelemetry-0.136.0-signal-corpus', 'test-corpus', '0.136.0', 'standards/corpora/opentelemetry-0.136.0', 'tree'],
['workflow-reusable-sdk', 'workflow', '0.4.0', '.github/workflows/sdk.yml'],
['workflow-reusable-sdk', 'workflow', '0.5.0', '.github/workflows/sdk.yml'], // x-release-please-version
];
const inputRoot = '/opt/prismpm/share/vv-inputs';
const inputPolicyBytes = await readFile('/opt/prismpm/share/vv-input-policy.json');
Expand Down
2 changes: 1 addition & 1 deletion sdk/oracles/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@prismpm/upstream-oracles",
"version": "0.4.0",
"version": "0.5.0",
"private": true,
"type": "module",
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion sdk/runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
},
"name": "prismpm-system-runtime",
"private": true,
"version": "0.4.0"
"version": "0.5.0"
}
Loading
Loading