Prepare Prompt SDK v1 API and release readiness (#72) - #15
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c5db787f82
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (lock) { | ||
| if (!Array.isArray(lock.contracts) || lock.contracts.length !== names.length) blockers.push('Contract lock must contain exactly five contracts.'); |
There was a problem hiding this comment.
Reject falsy parsed contract locks
When the follow-up release change sets the package and contract statuses to stable, a contract-lock.json containing valid but structurally invalid JSON such as null or false produces no read error and skips this entire block, allowing releaseReadiness() to return ready: true without any of the five required contracts. Validate the parsed value as an object and add a blocker unless it contains the required contracts array.
Useful? React with 👍 / 👎.
| const schema = Array.isArray(entry?.assets) ? entry.assets.find(asset => asset?.media_type === 'application/schema+json') : undefined; | ||
| if (entries.length !== 1 || entry.repository !== 'DefinitelySecureStudio/codex' || entry.version !== '1.0.0' || | ||
| entry.tag !== 'contract/' + name + '/v1.0.0' || !/^[0-9a-f]{40}$/.test(entry.commit ?? '') || | ||
| entry.publication?.immutable !== true || !Number.isFinite(Date.parse(entry.publication?.verified_at)) || |
There was a problem hiding this comment.
Enforce RFC 3339 verification timestamps
When an adoption lock contains an ambiguous or non-RFC-3339 value such as 09/11/2026, 2026-09-11, or a timestamp without a time-zone offset, Date.parse still returns a finite value, so the readiness gate accepts verification evidence that violates the documented lock format. Check the required RFC 3339 syntax, including Z or an explicit offset, before accepting the parsed timestamp.
Useful? React with 👍 / 👎.
| entry.publication?.immutable !== true || !Number.isFinite(Date.parse(entry.publication?.verified_at)) || | ||
| !schema || !Number.isSafeInteger(schema.byte_size) || schema.byte_size < 1 || | ||
| !/^sha256:[0-9a-f]{64}$/.test(schema.sha256 ?? '') || | ||
| !schema.artifact_uri?.startsWith('https://github.com/DefinitelySecureStudio/codex/releases/download/' + encodeURIComponent(entry.tag) + '/')) { |
There was a problem hiding this comment.
Treat non-string artifact URIs as blockers
When a structurally malformed lock supplies a numeric, object, or boolean artifact_uri, the optional chain does not protect the method call and startsWith throws instead of returning the promised machine-readable not-ready report. Check that artifact_uri is a string before applying the prefix test so malformed reviewed input fails closed through blockers rather than terminating the checker.
Useful? React with 👍 / 👎.
Summary
Verification
Coordination
Part of DefinitelySecureStudio/studio#72. Depends on DefinitelySecureStudio/codex#10; merge Codex first. These are preparation PRs: after owner merge, publish and verify five immutable Codex contract releases, adopt their lock/pins, transition stable lifecycle and versions, then publish Platform. Do not close #72 or Epic #4 until actual release verification. No npm publication or visibility change is included.