-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/cyclic topology #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
821fe87
feat(bex): bridge Contracts exact-value capabilities
piotr-blue d91c4c6
build(bex): add isolated SDK staging lane
piotr-blue 7532953
build(bex): stage against language rc.21
piotr-blue 7b0c823
fix(build): distinguish staged Language provenance
piotr-blue 8f008c4
fix(build): fail closed on SDK staging evidence
piotr-blue 6759657
docs(release): separate SDK verify from publish
piotr-blue 96854d2
fix(build): isolate candidate from release evidence
piotr-blue 23e9e62
build(bex): bind stage to final Language head
piotr-blue 8ee7d1f
chore: bind BEX release gates to published Language rc.21
piotr-blue File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
This file was deleted.
Oops, something went wrong.
134 changes: 134 additions & 0 deletions
134
.github/scripts/compare-published-conformance-evidence.mjs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,134 @@ | ||
| #!/usr/bin/env node | ||
|
|
||
| import { createHash } from 'node:crypto'; | ||
| import { readFileSync, writeFileSync } from 'node:fs'; | ||
|
|
||
| const [firstPath, secondPath, thirdPath, fourthPath, | ||
| bexCommit, outputPath] = process.argv.slice(2); | ||
| if (!firstPath || !secondPath || !thirdPath || !fourthPath || | ||
| !bexCommit || !outputPath) { | ||
| throw new Error( | ||
| 'usage: compare-published-conformance-evidence.mjs ' + | ||
| 'REPORT1 REPORT2 REPORT3 REPORT4 COMMIT OUTPUT' | ||
| ); | ||
| } | ||
|
|
||
| const reports = [firstPath, secondPath, thirdPath, fourthPath] | ||
| .map((path) => JSON.parse(readFileSync(path, 'utf8'))); | ||
| if (!/^[0-9a-f]{40}$/.test(bexCommit)) { | ||
| throw new Error(`invalid BEX commit: ${bexCommit}`); | ||
| } | ||
| const semanticKeys = [ | ||
| 'identities', | ||
| 'finalTotals', | ||
| 'normativeVectorCoverage', | ||
| 'operatorCoverage', | ||
| 'representationMatrix', | ||
| 'representationMatrixResult', | ||
| 'cacheMatrix', | ||
| 'recursionEvidence', | ||
| 'finiteLoopEvidence', | ||
| 'semanticBoundaryInvocationEvidence', | ||
| 'cyclicProofEvidence', | ||
| 'cyclicProofUnavailabilityCapability', | ||
| 'intrinsicEvidence', | ||
| 'referenceEvidenceClassificationEvidence', | ||
| 'hostedLocalLimitCapability', | ||
| 'ledgerLifecycleEvidence' | ||
| ]; | ||
| const gasKeys = [ | ||
| 'identities', | ||
| 'finalTotals', | ||
| 'counterCoverage', | ||
| 'gasExhaustionEvidence', | ||
| 'gasExhaustionTraceExamples', | ||
| 'maximumObservedOrderedTraceEntries' | ||
| ]; | ||
|
|
||
| function selected(report, keys) { | ||
| return Object.fromEntries(keys.map((key) => [key, report[key] ?? null])); | ||
| } | ||
|
|
||
| function canonical(value) { | ||
| if (Array.isArray(value)) { | ||
| return `[${value.map(canonical).join(',')}]`; | ||
| } | ||
| if (value && typeof value === 'object') { | ||
| return `{${Object.keys(value).sort().map( | ||
| (key) => `${JSON.stringify(key)}:${canonical(value[key])}` | ||
| ).join(',')}}`; | ||
| } | ||
| return JSON.stringify(value); | ||
| } | ||
|
|
||
| function digest(value) { | ||
| return createHash('sha256').update(canonical(value)).digest('hex'); | ||
| } | ||
|
|
||
| function repeated(values) { | ||
| return values.length === 4 && values.every((value) => value === values[0]); | ||
| } | ||
|
|
||
| const modes = reports.map((report) => report.dependency?.mode ?? 'missing'); | ||
| const coordinates = reports.map( | ||
| (report) => report.dependency?.declaredCoordinate ?? 'missing' | ||
| ); | ||
| const artifactHashes = reports.map( | ||
| (report) => report.dependency?.resolution?.artifact?.sha256 ?? 'missing' | ||
| ); | ||
| const semanticHashes = reports.map( | ||
| (report) => digest(selected(report, semanticKeys)) | ||
| ); | ||
| const gasHashes = reports.map( | ||
| (report) => digest(selected(report, gasKeys)) | ||
| ); | ||
| const allowedIncompleteGate = | ||
| 'independent-clean-build-reproducibility-gate-not-passing'; | ||
| const sourceBound = reports.every((report) => report.commit === bexCommit); | ||
| const publishedModes = modes.every((mode) => mode === 'standalone-published'); | ||
| const dependencyResolutionPassed = reports.every((report) => | ||
| report.dependency?.resolution?.status === 'passed' && | ||
| report.languageReleaseIdentity | ||
| ?.currentDependencyExactFinalArtifactProven === true | ||
| ); | ||
| const noUnexpectedFailures = reports.every((report) => | ||
| Array.isArray(report.currentModeFailures) && | ||
| report.currentModeFailures.every( | ||
| (failure) => failure === allowedIncompleteGate | ||
| ) | ||
| ); | ||
| const dependencyIdentityRepeated = repeated(coordinates) && | ||
| repeated(artifactHashes) && /^[0-9a-f]{64}$/.test(artifactHashes[0]); | ||
| const semanticAndGasRepeatability = repeated(semanticHashes); | ||
| const exactGasTraceRepeatability = repeated(gasHashes); | ||
| const passed = sourceBound && publishedModes && dependencyResolutionPassed && | ||
| noUnexpectedFailures && dependencyIdentityRepeated && | ||
| semanticAndGasRepeatability && exactGasTraceRepeatability; | ||
|
|
||
| const report = { | ||
| schema: 'blue-bex-published-conformance-repeatability/1.0', | ||
| status: passed ? 'passed' : 'failed', | ||
| dependencyPolicy: 'published-only', | ||
| bexCommit, | ||
| runCount: reports.length, | ||
| modes, | ||
| coordinates, | ||
| sourceBound, | ||
| dependencyResolutionPassed, | ||
| noUnexpectedFailures, | ||
| dependencyIdentityRepeated, | ||
| semanticAndGasRepeatability: semanticAndGasRepeatability | ||
| ? 'passed' : 'failed', | ||
| exactGasTraceRepeatability: exactGasTraceRepeatability | ||
| ? 'passed' : 'failed', | ||
| semanticEvidenceSha256: semanticHashes, | ||
| gasEvidenceSha256: gasHashes, | ||
| dependencyArtifactSha256: artifactHashes | ||
| }; | ||
| writeFileSync(outputPath, `${JSON.stringify(report, null, 2)}\n`); | ||
| if (!passed) { | ||
| console.error( | ||
| `Published conformance repeatability failed: ${outputPath}` | ||
| ); | ||
| process.exitCode = 1; | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the repository serves different focused module JARs to the four isolated builds while the aggregate
blue-language-javaJAR remains unchanged, this repeatability check still reportsdependencyIdentityRepeatedbecause it compares onlyresolution.artifact.sha256for the aggregate. Each report already containsdependency.resolution.artifacts, so the complete name/hash set should be compared; otherwise the published-repeatability receipt can claim identical dependencies for builds that actually compiled and ran against different Language module bytes.Useful? React with 👍 / 👎.