Skip to content

fix(storage): keep the scenario manifest key deployments registered under - #469

Closed
BobbyZhouZijian wants to merge 1 commit into
mainfrom
fix/scenario-manifest-key
Closed

BobbyZhouZijian wants to merge 1 commit into
mainfrom
fix/scenario-manifest-key

Conversation

@BobbyZhouZijian

Copy link
Copy Markdown
Contributor

Motivation

#412 renamed the artifact manifest key that carries a scenario's registration from scenario_snapshot to scenario_commit_record. That key is written into reef-artifact.json on the scenario ref of every deployment, so a deployment upgraded past #412 finds no registration for any of its scenarios: the factory retries fork(), which is a no-op because the ref already exists, and every scenario fails to load with

reef.core.errors.ReefError: scenario backend did not persist registration metadata for '<scenario>'

Observed on the harness-evolve deployment behind api.reefinfra.ai after moving from #353 to #432: all six scenarios listed loaded: false and every harness route answered 404.

Changes

  • reef/storage/commits.py: SCENARIO_METADATA_KEY is scenario_snapshot again, with a comment saying the value is the on-disk contract and does not follow code renames. The Python name and the CommitRecord vocabulary from refactor: simplify scenario storage and remove package dependency cycles #412 stay.
  • tests/reef_service/test_commit_log.py, tests/reef_service/test_reef_git_lfs.py: the tests that read the manifest pin the literal key so a future rename is caught.
  • docs/advanced_topics/state-model.rst: names the persisted key.

Compatibility and operational impact

Persisted data: restores the manifest key every deployment registered before #412 holds. A scenario registered by a build between #412 (2026-09-12) and this fix has scenario_commit_record in its manifest and would need to be re-registered; no such deployment is known besides local development runs. No API, wire, or configuration change.

Verification

.venv/bin/python -m pytest tests/reef_service/test_commit_log.py tests/reef_service/test_reef_git_lfs.py \
  tests/reef_service/test_reef_scenarios.py tests/reef_service/test_scenario_store.py \
  tests/reef_service/test_scenario_history.py -q
125 passed in 23.69s

pre-commit run --files reef/storage/commits.py tests/reef_service/test_reef_git_lfs.py \
  tests/reef_service/test_commit_log.py docs/advanced_topics/state-model.rst
all hooks passed

.venv/bin/python -m mypy
Success: no issues found in 289 source files

Deployed this branch on the EC2 harness-evolve deployment (reef main #432 plus this commit): the six pre-#412 scenarios load again after restart. Results are in the PR discussion once the restart is confirmed.

AI assistance

Claude Code (Claude Fable 5.1) diagnosed the failure on the deployment, wrote the change, the test updates and this description. The author reviewed every line and ran the checks above.

Checklist

  • The change is focused and contains no unrelated cleanup.
  • Tests cover behavior changes, or this pull request does not change behavior.
  • Public interface changes include contract tests, or no public interface changes are present.
  • Affected user and developer documentation is updated, or no documentation update is required.
  • Root README changes update both languages and README.i18n.yaml, or do not affect README content.
  • An accepted RFC is linked, or this change does not require an RFC.
  • Relevant pre-commit and test checks pass.
  • Non-trivial AI assistance is disclosed above, or none was used.

🤖 Generated with Claude Code

…nder

The storage simplification (#412) renamed the artifact manifest key that
carries a scenario's registration from `scenario_snapshot` to
`scenario_commit_record`. The key is written into `reef-artifact.json` on
the scenario ref of every deployment, so after an upgrade the factory finds
no registration, the fork it retries is a no-op because the ref exists, and
every existing scenario fails to load with "scenario backend did not persist
registration metadata".

Restore the persisted key and pin it in the tests that read the manifest.
The Python name `SCENARIO_METADATA_KEY` and the `CommitRecord` vocabulary
stay as #412 left them; only the on-disk value returns to what registered
deployments hold.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Merge Oncall: @BobbyZhouZijian

The merge oncall will route reviews and keep this pull request moving toward a clear decision.

@github-actions github-actions Bot added area: docs User and developer documentation area: service Service APIs, deployment, and command-line interfaces labels Sep 14, 2026
@BobbyZhouZijian

Copy link
Copy Markdown
Contributor Author

Deployment check on the EC2 harness-evolve box (reef 58765b7f main #432 plus this commit, schema-version 2 config, six scenarios registered under #353):

  • Before this commit: GET /reef/scenarios listed all six with loaded: false; the service log showed scenario backend did not persist registration metadata for '<scenario>' for each.
  • After restart on this branch: all six report loaded: true with the same release_id as before the upgrade (a982a650, 106f26f9, a93bae75, 022e8e0f, 4ccf478d, 411ed733); /reef/scenarios/<name>/releases and /reef/harness answer 200 for each; a POST /v1/chat/completions through the service returns 200 from the upstream.

🤖 Generated with Claude Code

@BobbyZhouZijian

Copy link
Copy Markdown
Contributor Author

Closing: the maintainer wants the key to stay scenario_commit_record (the snapshot vocabulary is gone on purpose). Deployments registered before #412 need their scenarios re-registered instead.

@BobbyZhouZijian
BobbyZhouZijian deleted the fix/scenario-manifest-key branch September 14, 2026 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: docs User and developer documentation area: service Service APIs, deployment, and command-line interfaces

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant