-
Notifications
You must be signed in to change notification settings - Fork 0
fix(acquisition): refresh manifest before integrity audit #510
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
51 commits
Select commit
Hold shift + click to select a range
b44897f
test(acquisition): refresh manifest after license inventory
seonghobae cd90d8e
fix(acquisition): refresh manifest before integrity audit
seonghobae 67544d8
test(acquisition): reject stale pre-audit manifest artifact
seonghobae 8840166
fix(acquisition): eliminate stale pre-audit manifest artifact
seonghobae b5bdfc3
test(acquisition): bind source revalidation to canonical audit
seonghobae c7b4e4e
test(acquisition): prevent duplicate manifest materialization
seonghobae 79ff003
merge main into acquisition audit repair
seonghobae e254098
merge main into acquisition audit manifest refresh
seonghobae 28d45cf
merge main into acquisition audit manifest refresh
seonghobae cf2da98
merge(main): converge acquisition audit repair
seonghobae d89afcd
Merge remote-tracking branch 'origin/main' into fix/acquisition-audit…
seonghobae 7d875a0
fix(acquisition): share audit output authority
seonghobae fdbe0c3
fix(acquisition): unify conflicting output overrides
seonghobae a7c2994
Merge remote-tracking branch 'origin/main' into fix/acquisition-audit…
seonghobae c078a8b
fix(acquisition): make audit orchestration portable
seonghobae bcce8b6
Merge remote-tracking branch 'origin/main' into fix/acquisition-audit…
seonghobae 60d40c1
test(acquisition): require audit executable in buyer catalog
seonghobae 67f91b3
test(acquisition): hash canonical audit executable
seonghobae 4846e5d
test(acquisition): bind audit executable in composed catalog
seonghobae 5a56834
fix(acquisition): hash canonical audit executable
seonghobae b445074
test(acquisition): require one canonical hourly audit
seonghobae 3368c13
fix(acquisition): remove duplicate hourly manifest
seonghobae ae3bd1d
fix(acquisition): hash tracked blobs in process
seonghobae 2eb5e45
fix(acquisition): support SHA-256 exact heads
seonghobae 60e581b
fix(acquisition): carry SHA-256 commit identity
seonghobae 03682c7
Merge remote-tracking branch 'origin/main' into fix/acquisition-audit…
seonghobae 9ff8923
fix(release): produce SHA-256 commit evidence
seonghobae 7858a26
fix(acquisition): pin stages to initial head
seonghobae 06bf671
Merge remote-tracking branch 'origin/main' into fix/acquisition-audit…
seonghobae 7df4326
fix(acquisition): canonicalize stage revision
seonghobae 652c4ce
Merge remote-tracking branch 'origin/main' into fix/acquisition-audit…
seonghobae 7e80488
fix: support legacy Git tree inventory
seonghobae f79b920
chore(acquisition): preserve protected-main changelog truth
seonghobae 7da63c0
chore(acquisition): converge protected main
seonghobae 609c018
test(acquisition): reject source movement between audit stages
seonghobae 0d3bcd7
fix(acquisition): fail closed on source movement between stages
seonghobae caa8d88
test(acquisition): reject tracked source drift during audit
seonghobae 8ff8a65
fix(acquisition): authenticate tracked source between audit stages
seonghobae cccddc3
Merge remote-tracking branch 'origin/main' into fix/acquisition-audit…
seonghobae de8324d
fix(acquisition): authenticate inventory input bytes
seonghobae ce82139
test(acquisition): bind dependency inventory to claimed commit
seonghobae 431c734
Merge remote-tracking branch 'origin/fix/acquisition-audit-manifest-r…
seonghobae 26a7b79
test(acquisition): preserve source-binding diagnostic
seonghobae db1a730
test(acquisition): revalidate source after failed stage
seonghobae 3541bed
fix(acquisition): revalidate source after stage failure
seonghobae 85ad4e8
fix(acquisition): revalidate failed stages
seonghobae f63c97b
docs(acquisition): document SHA-256 commit identities
seonghobae 6d31d58
Merge remote-tracking branch 'origin/fix/acquisition-audit-manifest-r…
seonghobae 6d84683
test(acquisition): match failed-stage preflight diagnostic
seonghobae 6fe5dbb
test(acquisition): cover empty pinned file bytes
seonghobae bffb5ba
merge(main): converge acquisition audit after #525
seonghobae 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 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 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 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 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 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 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,85 @@ | ||
| #!/usr/bin/env node | ||
| import { spawnSync } from "node:child_process"; | ||
| import { join } from "node:path"; | ||
| import { pathToFileURL } from "node:url"; | ||
| import { verifyAcquisitionTrackedCheckout } from "./lib/acquisition-git-preflight.mjs"; | ||
|
|
||
| const stages = [ | ||
| ["npm", "release:dependency-license-inventory"], | ||
| ["npm", "acquisition:manifest"], | ||
| ["npm", "acquisition:integrity"], | ||
| ["node", "scripts/acquisition-readiness-audit.mjs"], | ||
| ["npm", "acquisition:deployment-evidence"], | ||
| ]; | ||
|
devin-ai-integration[bot] marked this conversation as resolved.
|
||
|
|
||
| function checkedSpawn(command, args, options) { | ||
| const result = spawnSync(command, args, options); | ||
| if (result.error) throw result.error; | ||
| return result.status ?? 1; | ||
| } | ||
|
|
||
| function resolveHeadRevision(cwd) { | ||
| const git = spawnSync("git", ["rev-parse", "HEAD"], { cwd, encoding: "utf8" }); | ||
| if (git.error) throw git.error; | ||
| if (git.status !== 0) throw new Error("git rev-parse HEAD failed"); | ||
| return git.stdout.trim(); | ||
| } | ||
|
|
||
| function canonicalRevision(value) { | ||
| if (!/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/i.test(value)) { | ||
| throw new Error("one full commit SHA is required"); | ||
| } | ||
| return value.toLowerCase(); | ||
| } | ||
|
|
||
| export function runAcquisitionAudit({ | ||
| cwd = process.cwd(), | ||
| env = process.env, | ||
| spawn = checkedSpawn, | ||
| revision, | ||
| resolveRevision, | ||
| } = {}) { | ||
| const requireLiveSource = revision === undefined; | ||
| const liveRevision = resolveRevision ?? (() => resolveHeadRevision(cwd)); | ||
| const expectedRevision = canonicalRevision( | ||
| requireLiveSource ? liveRevision() : revision, | ||
| ); | ||
|
|
||
| const outputDirectory = env.NOEMA_ACQUISITION_AUDIT_OUTPUT_DIR | ||
| || env.NOEMA_DATA_ROOM_OUTPUT_DIR | ||
| || join(cwd, "artifacts", "acquisition-readiness", expectedRevision); | ||
| const stageEnv = { | ||
| ...env, | ||
| NOEMA_ACQUISITION_AUDIT_OUTPUT_DIR: outputDirectory, | ||
| NOEMA_DATA_ROOM_OUTPUT_DIR: outputDirectory, | ||
| NOEMA_DATA_ROOM_SOURCE_COMMIT: expectedRevision, | ||
| }; | ||
|
seonghobae marked this conversation as resolved.
seonghobae marked this conversation as resolved.
seonghobae marked this conversation as resolved.
|
||
| const npmExecPath = env.npm_execpath; | ||
| if (!npmExecPath) throw new Error("npm_execpath is required"); | ||
|
|
||
| const assertLiveSource = () => { | ||
| if (!requireLiveSource) return; | ||
| if (canonicalRevision(liveRevision()) !== expectedRevision) { | ||
| throw new Error("acquisition audit source revision changed during execution"); | ||
| } | ||
| if (resolveRevision === undefined) { | ||
| verifyAcquisitionTrackedCheckout({ | ||
| cwd, | ||
| expectedCommitSha: expectedRevision, | ||
| }); | ||
| } | ||
| }; | ||
|
|
||
| for (const [runtime, name] of stages) { | ||
| assertLiveSource(); | ||
| const args = runtime === "npm" ? [npmExecPath, "run", name] : [name]; | ||
| const status = spawn(process.execPath, args, { cwd, env: stageEnv, stdio: "inherit" }); | ||
| assertLiveSource(); | ||
|
seonghobae marked this conversation as resolved.
|
||
| if (Number.isInteger(status) && status !== 0) return status; | ||
| } | ||
| return 0; | ||
| } | ||
|
|
||
| if (process.argv[1] && pathToFileURL(process.argv[1]).href === import.meta.url) { | ||
| process.exitCode = runAcquisitionAudit(); | ||
| } | ||
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 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 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 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 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
Empty file.
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 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 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
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.
Uh oh!
There was an error while loading. Please reload this page.