Harden schema version workflow for parallel relic stats #156

Closed
opened 2026-04-28 19:24:23 -07:00 by nelsong6 · 0 comments
nelsong6 commented 2026-04-28 19:24:23 -07:00 (Migrated from github.com)

Problem

Relic stats often add persisted fields to RunData. Under the current convention, each persisted field addition usually requires a schema bump, a new fixture, and updates to schema-loading tests.

That is correct in principle, but it is easy for issue-agent implementations to make partial schema updates. The Happy Flower run was a concrete example: it bumped CurrentSchemaVersion from v18 to v19 and correctly reclassified the v18 fixture as legacy in the test name, but left the old Assert.False(loaded.IsLegacy) assertion in place. Verification caught the regression before PR creation.

Why This Gets Painful

  • Schema bumps are regular work for persisted relic stats, not a rare event.
  • The previous current fixture becomes legacy after every bump, so tests need paired semantic updates.
  • The current tests encode legacy/current expectations manually, which creates a small but repeated footgun.
  • Parallel relic branches can collide if two agents both start from the same main and both choose the next schema number.
  • The current workflow builds locally on self-hosted runners; GitHub artifacts are reports/screenshots/handoffs, not shared cloud-built mod binaries that solve schema sequencing.

Current Recommendation

Keep schema versioning. It is still useful because it proves older run files remain loadable and resumable after additive changes.

Harden the workflow around it:

  1. Replace repeated hardcoded IsLegacy assertions with a generic assertion derived from fixture schema version:
    • loaded.IsLegacy == (loaded.SourceSchemaVersion != RunData.CurrentSchemaVersion)
  2. Add a deterministic schema-bump preflight in verification:
    • if a branch changes RunData.CurrentSchemaVersion, compare against current origin/main
    • fail early with a clear message if main has already moved the schema and the branch needs rebase/update
  3. Consider, but do not immediately adopt, release-boundary schema bumps for additive fields:
    • this could reduce friction for relic onboarding
    • tradeoff: weaker one-fixture-per-persisted-field discipline

Desired Outcome

Agents should be able to add persisted relic stats without hand-maintaining fragile schema assertions, and parallel relic work should fail early and legibly when schema sequencing conflicts occur.

## Problem Relic stats often add persisted fields to `RunData`. Under the current convention, each persisted field addition usually requires a schema bump, a new fixture, and updates to schema-loading tests. That is correct in principle, but it is easy for issue-agent implementations to make partial schema updates. The Happy Flower run was a concrete example: it bumped `CurrentSchemaVersion` from v18 to v19 and correctly reclassified the v18 fixture as legacy in the test name, but left the old `Assert.False(loaded.IsLegacy)` assertion in place. Verification caught the regression before PR creation. ## Why This Gets Painful - Schema bumps are regular work for persisted relic stats, not a rare event. - The previous current fixture becomes legacy after every bump, so tests need paired semantic updates. - The current tests encode legacy/current expectations manually, which creates a small but repeated footgun. - Parallel relic branches can collide if two agents both start from the same main and both choose the next schema number. - The current workflow builds locally on self-hosted runners; GitHub artifacts are reports/screenshots/handoffs, not shared cloud-built mod binaries that solve schema sequencing. ## Current Recommendation Keep schema versioning. It is still useful because it proves older run files remain loadable and resumable after additive changes. Harden the workflow around it: 1. Replace repeated hardcoded `IsLegacy` assertions with a generic assertion derived from fixture schema version: - `loaded.IsLegacy == (loaded.SourceSchemaVersion != RunData.CurrentSchemaVersion)` 2. Add a deterministic schema-bump preflight in verification: - if a branch changes `RunData.CurrentSchemaVersion`, compare against current `origin/main` - fail early with a clear message if main has already moved the schema and the branch needs rebase/update 3. Consider, but do not immediately adopt, release-boundary schema bumps for additive fields: - this could reduce friction for relic onboarding - tradeoff: weaker one-fixture-per-persisted-field discipline ## Desired Outcome Agents should be able to add persisted relic stats without hand-maintaining fragile schema assertions, and parallel relic work should fail early and legibly when schema sequencing conflicts occur.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
romaine-life/spirelens#156
No description provided.