mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-05-06 09:38:33 -05:00
Lays foundation for unified release versioning across MLSysBook publishable artifacts. Pure additions — no existing builds, configs, or sources are touched. scripts/version/release.py Python CLI with helpers: - compute-id: semver bump from previous tag (patch/minor/major/none/explicit) - compute-hash: deterministic SHA-256 over input directories with per-file index - emit-release: writes releases/<project>-<id>/release.json (canonical artifact) - emit-manifest: writes the build-time manifest the deployable bundles Tier A (citable) emits per-file Merkle index; Tier B (lite) is flat. scripts/version/schema.json JSON Schema for release.json. Validates project/tier/release_id/release_hash + Tier A's files[] index. Used by validators in CI. shared/release/release-pill.html Footer snippet — fetches deployable manifest at runtime, renders "v0.1.0 · Apr 26, 2026" pill. Configured per-project via <meta name="release-manifest"> tag. Silent on any fetch failure. shared/release/release-card.html About-page snippet — fuller release-identity card with click-to-copy hash. Same fetch + meta-tag conventions. shared/release/README.md Operator-facing contract documentation. .github/workflows/_release-prepare.yml Reusable workflow_call. Validates confirm == "PUBLISH", computes new_release_id from previous tag + bump (delegates to release.py for canonical math). Outputs new_release_id/new_tag/previous_* for caller's downstream build and finalize steps. Refuses to re-tag existing releases (citation integrity). Caller workflows still own their build commands and tag/release creation; this only standardizes the input shape and version math.
90 lines
2.8 KiB
JSON
90 lines
2.8 KiB
JSON
{
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"$id": "https://mlsysbook.ai/schemas/release.json",
|
|
"title": "MLSysBook release artifact",
|
|
"description": "Canonical shape of releases/<project>-<id>/release.json across all MLSysBook publishable artifacts. Tier A includes per-file hashes; Tier B does not.",
|
|
"type": "object",
|
|
"required": [
|
|
"release_schema_version",
|
|
"project",
|
|
"tier",
|
|
"release_id",
|
|
"release_hash",
|
|
"schema_version",
|
|
"git_sha",
|
|
"created_at",
|
|
"input_paths",
|
|
"metadata"
|
|
],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"release_schema_version": {
|
|
"type": "string",
|
|
"description": "Version of THIS schema. Bumped when release.json shape changes."
|
|
},
|
|
"project": {
|
|
"type": "string",
|
|
"description": "Short project identifier, e.g. 'staffml', 'tinytorch', 'book-vol1'.",
|
|
"pattern": "^[a-z][a-z0-9-]*$"
|
|
},
|
|
"tier": {
|
|
"type": "string",
|
|
"enum": ["A", "B"],
|
|
"description": "Adoption tier. A = citable (Merkle), B = lite (flat hash)."
|
|
},
|
|
"release_id": {
|
|
"type": "string",
|
|
"description": "Human-meaningful semver, e.g. '0.1.0' or '1.2.3-rc1'.",
|
|
"pattern": "^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?$"
|
|
},
|
|
"release_hash": {
|
|
"type": "string",
|
|
"description": "Full hex digest binding the release to its input bytes.",
|
|
"pattern": "^[0-9a-f]{16,}$"
|
|
},
|
|
"schema_version": {
|
|
"type": "string",
|
|
"description": "Project-internal schema version (e.g. vault question schema)."
|
|
},
|
|
"previous_release_id": {
|
|
"type": ["string", "null"],
|
|
"description": "Previous release_id of this project (for changelog continuity)."
|
|
},
|
|
"git_sha": {
|
|
"type": "string",
|
|
"description": "Git commit SHA the release was built from.",
|
|
"pattern": "^[0-9a-f]{7,40}$"
|
|
},
|
|
"created_at": {
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"description": "ISO 8601 UTC timestamp of release artifact emission."
|
|
},
|
|
"input_paths": {
|
|
"type": "array",
|
|
"items": {"type": "string"},
|
|
"description": "Paths (relative to repo root) hashed to produce release_hash."
|
|
},
|
|
"files": {
|
|
"type": "array",
|
|
"description": "Tier A only: per-file hashes for partial verification.",
|
|
"items": {
|
|
"type": "object",
|
|
"required": ["path", "hash"],
|
|
"properties": {
|
|
"path": {"type": "string"},
|
|
"hash": {"type": "string", "pattern": "^[0-9a-f]{16,}$"}
|
|
}
|
|
}
|
|
},
|
|
"description": {
|
|
"type": "string",
|
|
"description": "One-line operator-supplied summary, mirrored from workflow input."
|
|
},
|
|
"metadata": {
|
|
"type": "object",
|
|
"description": "Project-specific metrics (page_count, question_count, module_count, etc.)."
|
|
}
|
|
}
|
|
}
|