diff --git a/CHANGELOG.md b/CHANGELOG.md index dee98b9..fe3dd78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ Repository-validated current release line for final Commons-style publication. - changed commercial receipts to normalize actor, reference, settlement, and verification semantics across verbs - changed release metadata to describe v1.1.0 as the current repository-validated line while keeping publication claims declarative - changed checksum validation to cover the shipped payload boundary excluding `checksums.txt` itself +- changed manifest validation to enforce state-aware release metadata (`release_date` null before publication; ISO date once published) ### Removed diff --git a/scripts/validate-all.mjs b/scripts/validate-all.mjs index 15fcfe3..274dd9b 100644 --- a/scripts/validate-all.mjs +++ b/scripts/validate-all.mjs @@ -116,8 +116,15 @@ async function validateManifest() { assert(manifest.examples_root === `examples/v${CURRENT_VERSION}`, "manifest examples_root drift"); assert(manifest.current_index === `schemas/v${CURRENT_VERSION}/index.json`, "manifest current_index drift"); assert(manifest.checksums_file === "checksums.txt", "manifest checksums_file drift"); - assert(manifest.release_date === null, "manifest release_date must remain null until publication is completed"); - assert(manifest.publication_state === "repository-validated-not-yet-published", "manifest publication_state drift"); + assert( + manifest.publication_state === "repository-validated-not-yet-published" || manifest.publication_state === "published", + "manifest publication_state must be repository-validated-not-yet-published or published" + ); + if (manifest.publication_state === "repository-validated-not-yet-published") { + assert(manifest.release_date === null, "manifest release_date must remain null until publication is completed"); + } else { + assert(typeof manifest.release_date === "string" && /^\d{4}-\d{2}-\d{2}$/.test(manifest.release_date), "manifest release_date must be an ISO date string when publication_state is published"); + } assert("declared_alignment" in manifest, "manifest must expose declarative alignment metadata"); assert(manifest.alignment_verification === "declarative-only", "manifest alignment verification mode drift"); assert(!("aligns_with" in manifest), "manifest aligns_with field must not imply verified enforcement");