Repository navigation
feat(emit-manifest): schema 1.1 — embed README content inline - #15
Conversation
Schema 1.1: summary.json.readme now ships {path, content, content_bytes,
sha256, truncated} for non-annexed READMEs up to 256 KB. Annexed,
oversize, binary, or unreadable READMEs ship truncated=true with
content=null so consumers fall back to fetching on demand.
Eliminates the per-pageload raw.githubusercontent.com round-trip that
was the dominant first-paint latency on ww2.nemar.org dataset pages.
Closes nemarOrg/nemar-cli#619 (epic #618).
…ests Addressing review findings from PR #15: - emit_manifest.py: every truncated branch now emits a structured stderr line (`readme_truncated` / `readme_extract_failed` with reason=…) so ops can grep for non-fast-path publishes. Thread dataset_id + version through derive_readme for those messages. - cat-file-failure branch now reports content_bytes=None instead of echoing the manifest's size — we never read the blob, so claiming a byte count was misleading. Documented in the derive_readme docstring. - New ReadmeBinaryTruncatedTests: locks the unique sha256-set-but- content-None 4-tuple. Includes >512-byte padding to sidestep a pre-existing build_manifest bug (filed as follow-up). - New ReadmeCatFileFailureTests: direct unit test against a bogus sha in an empty real-git repo; asserts truncated=True with all-None content fields and no crash. - Oversize fixture now uses multibyte UTF-8 so a future len(str) vs len(bytes) regression on content_bytes is visible. - test_summary_schema_version comment tightened: schema 1.1 is additive for path-keyed reads but breaks strict-equality checks on the old 1-key readme dict.
|
Addressed PR review (4 agents): High (silent-failure-hunter): added structured Medium (code-reviewer #2): Medium (code-reviewer #1) + comment-analyzer: rephrased the "additive" claim. Schema 1.1 is additive for path-keyed reads but breaks strict-equality checks against the old 1-key Severity 7 + 6 (pr-test-analyzer): added the two missing test classes:
Low (pr-test-analyzer): oversize README fixture now uses multibyte UTF-8 so a Out of scope, filed as follow-up: pre-existing latent bug in Tests: 45/45 passing locally (was 41 → +4). CI pending on this push. |
Summary
summary.jsonschema_version to 1.1readme.contentfor non-annexed READMEs ≤ 256 KBreadme.content_bytes,readme.sha256,readme.truncatedfor diagnostics and integritytruncated: true, content: nullso consumers fall backEliminates the per-pageload
raw.githubusercontent.comround-trip that was the dominant cold first-paint latency for the README panel onww2.nemar.org/dataset/<id>.Closes nemarOrg/nemar-cli#619
Phase 1 of nemarOrg/nemar-cli#618 (epic: summary.json schema 1.1 + page-bundle)
Contract
Schema 1.1 is additive. Consumers that only read
readme.path(schema 1.0 contract) keep working; the new fields just go unread.Edge cases (
truncated: true):keyis notgit:<sha>): content lives in S3, we don't have IAM herecontent_bytesrecords actual size,sha256left nullTest plan
test_summary_schema_version(asserts "1.1")test_summary_readme_content_inline(verifies inline embedding)test_summary_readme_metadata(content_bytes + sha256 correctness)ReadmeOversizeTruncatedTests(300 KB README → truncated)ReadmeAnnexedTruncatedTests(annex symlink README → truncated)ReadmeNoneSchema11Tests(no README → readme is None, schema still 1.1)test_readme_priority_picks_plain_READMEupdated to assert inline content from selected candidateworkflow_dispatch[generate-manifest]on nm099999 after merge, verify summary.json hasschema_version: "1.1"andreadme.contentCompanion work
readme.content(separate agent)