Skip to content

bugfix(baker): bake_scalar_source updates release-manifest.json (#251)#255

Merged
gerchowl merged 1 commit intodevfrom
bugfix/251-bake-scalar-manifest-update
Apr 30, 2026
Merged

bugfix(baker): bake_scalar_source updates release-manifest.json (#251)#255
gerchowl merged 1 commit intodevfrom
bugfix/251-bake-scalar-manifest-update

Conversation

@gerchowl
Copy link
Copy Markdown
Contributor

Summary

  • bake_scalar_source was writing <source>.json but never touching release-manifest.json. Pre-bugfix(client): read release-manifest.json directly to fix scale bug (#238) #239 the client reconstructed the manifest from a tree listing, so this was invisible. Post-bugfix(client): read release-manifest.json directly to fix scale bug (#238) #239 the client reads the static manifest directly, so every scalar bake (today: physicallybased) silently left its source absent from the manifest. We caught this on gerchowl/mat-vis@v2026.04.2 and patched prod manually (commit 63e84e2); this PR is structural only.
  • After the catalog commit, bake_scalar_source now enters the same CAS retry loop bake_one_per_file uses: fetch the current manifest + parent SHA, merge in {"scalar": {"complete": true}} under the source entry, commit with parent_commit=<sha>, retry on 412/409, exhaust at 6. Reuses _fetch_manifest_with_parent, _merge_manifest_for_source, and _create_commit_with_backoff — no duplication.
  • Drops the stale "clients derive the manifest from the dataset tree" line from the docstring.

Test plan

  • New tests/test_bake_scalar_source.py with three cases:
    • Two commits land (catalog + manifest), each carrying the right path.
    • Manifest payload carries {"physicallybased": {"catalog": "physicallybased.json", "tiers": {"scalar": {"complete": true}}}}.
    • Pre-existing sources in the manifest are preserved on merge; manifest commit opts into parent_commit for CAS.
  • Existing tests/test_bake_one_routing.py still green (return dict still carries materials).
  • Full baker suite green: uv run --extra baker pytest tests/ -q --ignore=tests/e2e --deselect tests/test_version_sync.py::test_client_runtime_version_matches_pyproject → 369 passed, 5 skipped, 1 deselected.
  • ruff check + ruff format --check clean on changed files.

Closes #251.

Pre-#251 ``bake_scalar_source`` only pushed ``<source>.json`` and never
touched ``release-manifest.json``. Pre-#239 the client reconstructed
the manifest from a tree listing, so the missing write was invisible.
After #239 the client reads the static manifest directly — meaning
every scalar bake (today: physicallybased) silently left its source
absent from the manifest, hiding it from clients. We caught this on
``gerchowl/mat-vis@v2026.04.2`` and patched prod manually
(commit 63e84e2).

This change is structural only — the prod manifest is already correct.

Apply the same CAS retry pattern ``bake_one_per_file`` uses for the
catalog + manifest commit:

- Push the catalog as before (one commit, via ``push_to_hf``).
- Then enter a CAS loop: fetch the current manifest + parent SHA,
  merge in ``{"scalar": {"complete": True}}`` under the source entry,
  commit with ``parent_commit=<sha>``. Retry on 412/409, exhaust at 6.

Reuses ``_fetch_manifest_with_parent`` and ``_merge_manifest_for_source``
from ``hf_bake_per_file`` and ``_create_commit_with_backoff`` from
``hf_retry`` — single contract evolves across both bakers.

Drops the stale "clients derive the manifest from the dataset tree"
docstring line.

Tests pin three properties:

1. Two commits land — catalog (one file) and manifest (one file).
2. The manifest payload carries
   ``{"physicallybased": {"catalog": "physicallybased.json",
   "tiers": {"scalar": {"complete": true}}}}``.
3. Pre-existing sources in the manifest are preserved on merge,
   and the manifest commit opts into ``parent_commit`` for CAS.
@github-actions github-actions Bot added area:testing Test infrastructure, BATS, pytest area:baker Baker pipeline, Dagger, data fetchers labels Apr 30, 2026
@gerchowl gerchowl enabled auto-merge (squash) April 30, 2026 15:51
@gerchowl gerchowl merged commit 690289c into dev Apr 30, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:baker Baker pipeline, Dagger, data fetchers area:testing Test infrastructure, BATS, pytest

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(baker): bake_scalar_source doesn't update release-manifest.json

1 participant