diff --git a/config/codex-termux-release-manifest.json b/config/codex-termux-release-manifest.json index 9512322..95e6e0e 100644 --- a/config/codex-termux-release-manifest.json +++ b/config/codex-termux-release-manifest.json @@ -1,16 +1,16 @@ { "canonical_package_name": "@bash0816/codex-termux", - "canonical_package_status": "published", - "public_distribution_status": "published", + "canonical_package_status": "ready_to_publish", + "public_distribution_status": "staged_for_publish", "support_status": "active", "latest_audited_version": "0.144.6", - "latest_candidate_version": "0.144.6", + "latest_candidate_version": "0.145.0", "previous_stable_version": "0.144.5", "candidate_state": "published", "candidate_state_status": "ready_to_publish", "audit_evidence_ref": "", "source_repo": "openai/codex", - "source_ref": "rust-v0.144.6", + "source_ref": "rust-v0.145.0", "tracked_versions": [ "0.141.0", "0.140.0", @@ -50,8 +50,8 @@ "rollback_policy": "Reinstall an explicit published version with npm to roll back.", "distribution_strategy": "public-npm-package", "audited_at": "2026-07-01T00:00:00+09:00", - "updated_at": "2026-07-20T08:19:50.604Z", - "build_run_id": "29701985280", - "source_sha": "5d1fbf26c43abc65a203928b2e31561cb039e06d", - "expected_build_run_id": "29701985280" + "updated_at": "2026-07-22T05:57:36.655Z", + "build_run_id": "29865539089", + "source_sha": "25af12f7e61572b0bc18ddb1008be543b91519b0", + "expected_build_run_id": "29865539089" } diff --git a/packages/codex-termux/config/codex-termux-release-manifest.json b/packages/codex-termux/config/codex-termux-release-manifest.json index 591e1df..607aa67 100644 --- a/packages/codex-termux/config/codex-termux-release-manifest.json +++ b/packages/codex-termux/config/codex-termux-release-manifest.json @@ -1,10 +1,10 @@ { "canonical_package_name": "@bash0816/codex-termux", - "canonical_package_status": "published", - "public_distribution_status": "published", + "canonical_package_status": "ready_to_publish", + "public_distribution_status": "staged_for_publish", "support_status": "active", "latest_audited_version": "0.144.6", - "latest_candidate_version": "0.144.6", + "latest_candidate_version": "0.145.0", "previous_stable_version": "0.144.5", "candidate_state": "published", "candidate_state_status": "ready_to_publish", @@ -38,7 +38,7 @@ "rollback_policy": "Reinstall an explicit published version with npm to roll back.", "distribution_strategy": "public-npm-package", "audited_at": "2026-07-01T00:00:00+09:00", - "updated_at": "2026-07-20T08:19:50.604Z", + "updated_at": "2026-07-22T05:57:36.655Z", "platform": "android", "arch": "arm64", "planned_wrapper_package": { diff --git a/packages/codex-termux/package.json b/packages/codex-termux/package.json index 17cb5a3..3109d2c 100644 --- a/packages/codex-termux/package.json +++ b/packages/codex-termux/package.json @@ -1,6 +1,6 @@ { "name": "@bash0816/codex-termux", - "version": "0.144.6", + "version": "0.145.0", "description": "Termux wrapper package for OpenAI Codex", "license": "GPL-3.0-only", "repository": { diff --git a/scripts/update-codex-candidate-manifest.js b/scripts/update-codex-candidate-manifest.js index 2d429ce..bc788d7 100644 --- a/scripts/update-codex-candidate-manifest.js +++ b/scripts/update-codex-candidate-manifest.js @@ -40,6 +40,50 @@ function updateManifests({ fs.writeFileSync(packagePath, `${JSON.stringify(packageManifest, null, 2)}\n`); } +/** + * Stage both root and package manifests to ready_to_publish after a + * successful build. Root manifest additionally records build provenance + * (build_run_id/source_ref/source_sha); package manifest schema does not + * carry those fields, so it is intentionally excluded from that part. + * + * @param {Object} opts + * @param {string} opts.rootPath - path to root manifest + * @param {string} opts.packagePath - path to package manifest + * @param {string} opts.buildRunId - build_run_id to record on root manifest + * @param {string} opts.sourceRef - source_ref to record on root manifest + * @param {string} opts.sourceSha - source_sha to record on root manifest + */ +function stageManifestsReadyToPublish({ + rootPath, + packagePath, + buildRunId, + sourceRef, + sourceSha, +}) { + if (!rootPath || !packagePath || !buildRunId || !sourceRef || !sourceSha) { + throw new Error('All parameters (rootPath, packagePath, buildRunId, sourceRef, sourceSha) are required'); + } + + const updatedAt = new Date().toISOString(); + + const rootManifest = JSON.parse(fs.readFileSync(rootPath, 'utf8')); + rootManifest.build_run_id = String(buildRunId); + rootManifest.source_ref = sourceRef; + rootManifest.source_sha = sourceSha; + rootManifest.candidate_state_status = 'ready_to_publish'; + rootManifest.canonical_package_status = 'ready_to_publish'; + rootManifest.public_distribution_status = 'staged_for_publish'; + rootManifest.updated_at = updatedAt; + fs.writeFileSync(rootPath, `${JSON.stringify(rootManifest, null, 2)}\n`); + + const packageManifest = JSON.parse(fs.readFileSync(packagePath, 'utf8')); + packageManifest.candidate_state_status = 'ready_to_publish'; + packageManifest.canonical_package_status = 'ready_to_publish'; + packageManifest.public_distribution_status = 'staged_for_publish'; + packageManifest.updated_at = updatedAt; + fs.writeFileSync(packagePath, `${JSON.stringify(packageManifest, null, 2)}\n`); +} + // CLI interface if (require.main === module) { const repoRoot = path.resolve(__dirname, '..'); @@ -54,27 +98,49 @@ if (require.main === module) { function usage() { console.error('usage: node scripts/update-codex-candidate-manifest.js '); + console.error(' node scripts/update-codex-candidate-manifest.js stage '); process.exit(2); } - const candidateVersion = process.argv[2]; - const candidateState = process.argv[3]; - - if (!candidateVersion || !candidateState) { - usage(); - } + const firstArg = process.argv[2]; - try { - updateManifests({ - rootPath: rootManifestPath, - packagePath: packageManifestPath, - candidateVersion, - candidateState, - }); - } catch (err) { - console.error('Error updating manifests:', err.message); - process.exit(1); + if (firstArg === 'stage') { + if (process.argv.length !== 6) { + usage(); + } + const buildRunId = process.argv[3]; + const sourceRef = process.argv[4]; + const sourceSha = process.argv[5]; + try { + stageManifestsReadyToPublish({ + rootPath: rootManifestPath, + packagePath: packageManifestPath, + buildRunId, + sourceRef, + sourceSha, + }); + } catch (err) { + console.error('Error staging manifests:', err.message); + process.exit(1); + } + } else { + if (process.argv.length !== 4) { + usage(); + } + const candidateVersion = process.argv[2]; + const candidateState = process.argv[3]; + try { + updateManifests({ + rootPath: rootManifestPath, + packagePath: packageManifestPath, + candidateVersion, + candidateState, + }); + } catch (err) { + console.error('Error updating manifests:', err.message); + process.exit(1); + } } } -module.exports = { updateManifests }; +module.exports = { updateManifests, stageManifestsReadyToPublish };