[v0.8 Release 1/3] bind artifacts to immutable source commits - #1176
[v0.8 Release 1/3] bind artifacts to immutable source commits#1176sethkarten wants to merge 5 commits into
Conversation
| function authoritativeSourceCommit() { | ||
| const result = spawnSync("git", ["rev-parse", "HEAD"], { cwd: resolve(new URL("..", import.meta.url).pathname), encoding: "utf8" }); | ||
| if (result.status !== 0) throw new Error(`Unable to resolve authoritative source HEAD: ${result.stderr.trim()}`); | ||
| return result.stdout.trim(); | ||
| } |
There was a problem hiding this comment.
🟠 High scripts/verify-prime-agent-release.mjs:36
authoritativeSourceCommit uses new URL("..", import.meta.url).pathname as cwd for git rev-parse, which produces a percent-encoded path (e.g. /repo%20name/... for spaces, or /C:/... on Windows) instead of a valid filesystem path. When the checkout path contains spaces or non-ASCII characters, git rejects the cwd and the verifier fails; on Windows the drive-letter form also breaks. Use fileURLToPath from node:url to convert the URL to a real filesystem path before passing it to spawnSync.
| function authoritativeSourceCommit() { | |
| const result = spawnSync("git", ["rev-parse", "HEAD"], { cwd: resolve(new URL("..", import.meta.url).pathname), encoding: "utf8" }); | |
| if (result.status !== 0) throw new Error(`Unable to resolve authoritative source HEAD: ${result.stderr.trim()}`); | |
| return result.stdout.trim(); | |
| } | |
| function authoritativeSourceCommit() { | |
| const result = spawnSync("git", ["rev-parse", "HEAD"], { cwd: fileURLToPath(new URL("..", import.meta.url)), encoding: "utf8" }); |
🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file @scripts/verify-prime-agent-release.mjs around lines 36-40:
`authoritativeSourceCommit` uses `new URL("..", import.meta.url).pathname` as `cwd` for `git rev-parse`, which produces a percent-encoded path (e.g. `/repo%20name/...` for spaces, or `/C:/...` on Windows) instead of a valid filesystem path. When the checkout path contains spaces or non-ASCII characters, `git` rejects the `cwd` and the verifier fails; on Windows the drive-letter form also breaks. Use `fileURLToPath` from `node:url` to convert the URL to a real filesystem path before passing it to `spawnSync`.
| const parsed = { artifactDir: undefined, channel: undefined, commit: undefined, dryRun: false, version: undefined }; | ||
| for (let i = 0; i < args.length; i += 1) { | ||
| switch (args[i]) { | ||
| case "--artifact-dir": parsed.artifactDir = resolve(args[++i] || ""); break; |
There was a problem hiding this comment.
🟡 Medium scripts/verify-prime-agent-release.mjs:22
Passing --artifact-dir without a value at the end of the command makes resolve("") resolve to the current working directory, so parsed.artifactDir is set and the required-argument check passes. The verifier then silently validates artifacts in the invocation directory instead of rejecting the malformed command, and can report success for the wrong directory if it happens to contain a valid artifact set. Consider checking that args[i] is present and not another option before consuming it.
- case "--artifact-dir": parsed.artifactDir = resolve(args[++i] || ""); break;
+ case "--artifact-dir": {
+ const dir = args[++i];
+ if (!dir || dir.startsWith("-")) throw new Error("--artifact-dir requires a value");
+ parsed.artifactDir = resolve(dir);
+ break;
+ }🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file @scripts/verify-prime-agent-release.mjs around line 22:
Passing `--artifact-dir` without a value at the end of the command makes `resolve("")` resolve to the current working directory, so `parsed.artifactDir` is set and the required-argument check passes. The verifier then silently validates artifacts in the invocation directory instead of rejecting the malformed command, and can report success for the wrong directory if it happens to contain a valid artifact set. Consider checking that `args[i]` is present and not another option before consuming it.
v0.8 stack checkpoint — 2026-08-11 15:50 UTCThis draft PR remains the GitHub Release stack surface and will be kept current.
No tag, version bump, release, or live publication has occurred. |
Phase 1 / 3 — immutable release provenance
Exact approved head:
c41df11ff38405e2352da306a5367fed0dc9cd27Branch:
v080/release→mainNarrow scope
REL01 exact provenance: bind release artifacts to the immutable source commit. The production workflow cleans and verifies the checked-out source before dependencies/build, permits only fixed generated
distoverlays for packing, and packages non-generated inputs from agit archiveof the asserted commit.Validation and review evidence
originat the exact SHA above.git diff --check origin/main...HEADpasses.Dependencies
Standalone REL01 provenance foundation; no unmerged implementation dependency is introduced by this draft.
Deferred / explicitly excluded
This draft has no work from #1158–#1165 and contains no ignored deferred work. It does not include later release phases beyond REL01.
Draft only: no reviewer requests and not ready for review yet.
Note
Bind release artifacts to immutable source commits for the v0.8 release pipeline
source_sha(peeled tag/commit) frompackage.jsonversion validation before any build or publish step runs.git archivesnapshot, and passes--committo the packer so artifacts carry the authoritative commit.source_shabefore uploading.verify-prime-agent-release.mjs,pack-prime-agent-release.mjs, andprime-agent-release-components.mjs— enforce a fixed four-component inventory, SHA-256 checks, and commit binding across pack and verify steps.📊 Macroscope summarized c41df11. 7 files reviewed, 0 issues evaluated, 0 issues filtered, 0 comments posted
🗂️ Filtered Issues
No issues evaluated.