Delete schema version, detect on-disk shape structurally #157
No reviewers
Labels
No labels
4-29
bug
documentation
duplicate
enhancement
flow improvement
good first issue
help wanted
invalid
investigating
issue-agent
issue-agent-blocked
issue-agent-complete
issue-agent-pr-open
issue-agent-runner-nelsonlaptop
issue-agent-runner-nelsonpc
issue-agent-runner-nelsonpc-user
issue-agent-running
needs-verification
next to do
question
queue
recon
relics-stats-onboarding
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
romaine-life/spirelens!157
Loading…
Reference in a new issue
No description provided.
Delete branch "refactor/delete-schema-version"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #156.
What changed
The
RunData.CurrentSchemaVersionconstant, theRunData.SchemaVersionproperty, theLoadedRunFile.SourceSchemaVersionfield, and theISpireLensApi.CurrentSchemaVersionAPI surface are all gone. The version-keyed switch inRunStorage.LoadKnownSchemaFileis replaced by a structural check: a file uses the per-instance shape iff its top-level JSON hasinstance_numbers_by_defordef_counters(the runtime always serializes both, even when empty); the historic pooled shape predates both fields and lacks them entirely.LoadedRunFile.IsLegacyis now!HasPerInstanceIdentity— a structural fact, not a comparison to a moving constant.Why
#156 surfaced this as a footgun: every persisted-field PR was bumping a sequential integer that three places had to agree on (the constant, the fixture filename, the test method), and parallel PRs would all pick the same next number off a stale main. The version was actually doing nothing load-bearing —
RunDatais additive, the JSON deserializer fills missing fields with safe defaults, and the only real shape divergence in the entire history is v1 (pooled) vs. v2+ (per-instance), which is detectable without an integer. Removing the version eliminates the contention class entirely; the next agent adding a relic stat doesn't need to pick a number, rename a fixture, or update anAssert.Equal(N, …)literal.Tests
SchemaLoadingTestskeeps every fixture-load test (one per checked-in shape). Per-testSourceSchemaVersion/SchemaVersion/IsLegacy/Assert.Contains("resumable", …)assertions are dropped — they were either tautological with the structural property or broken by the new compatibility-note semantics. Each test still pins its fixture's load-bearing data fields.v999-unknown-run.jsonfixture and its two tests are deleted: there's no concept of an "unknown schema" anymore.BagOfMarbles,Pocketwatch,Orichalcum) drop theirRunData_SchemaVersion_Is…tests; one inline-JSON test in each (proving missing-field deserialization defaults) is renamed away fromV17/V16/…framing but otherwise unchanged.Docs
AGENTS.md"When Changing Behavior" rewritten — no more "bumpRunData.CurrentSchemaVersion" step.docs/sts2-runtime-primer.md"Persistence And Schema" rewritten to describe structural detection.Fixtures/RunSchema/README.mdreframes the existingv*--prefixed fixtures as historical snapshots and notes that new fixtures don't need a prefix.Policy cleanup (out-of-scope but bundled per request)
AGENTS.md: removed "GitHub Source Of Truth" and "Scratch Workspace Guard Rails" sections.docs/pull-only-workflow.md: deleted.Risk
Low. The on-disk JSON format is unchanged (the
schema_versionfield is silently ignored on load and not written on new saves); old run files continue to load via the structural detector.ISpireLensApi.CurrentSchemaVersionhad no in-tree consumers and zero references inspire-lens-mcp, so removing it doesn't break the loader/MCP surface.