Skip to content

audit: version scorer-stamped records so older readers do not silently skip pending work #315

Closed

Description

@Birfy

Follow-up to merged #312

Tracks the existing P1 review finding, not a new independent defect.

#312 merged as main db4169803b73bf26170b3d532708af16ce18e13e, from head e824ba6f45fc45b62cd9be44a242ba3c1b0e9196. The relevant records.py and wiring.py are byte-identical between these commits.

Source-confirmed compatibility path

AuditRecord adds optional scorer_version and serializes it when nonempty, while SCHEMA_VERSION remains 1. Boost-attached writers stamp this field, including while the boost is inactive when scorer and measurement identities differ.

An older reader, including v0.6.0, accepts schema version 1 but has no scorer_version constructor parameter. Its from_dict forwards the new field to the old dataclass constructor, raising TypeError. The old loader catches TypeError as a corrupt record and skips it. A mixed-version resolver/worker or a downgrade therefore omits these pending records from its visible worklist instead of clearly refusing an unsupported format.

The bytes remain in the JSONL file. This report does not claim deletion of disk data, a production incident, or a locally executed reproduction.

Proposed regression scenario (not run)

  1. Produce a pending boosted audit record with nonempty scorer_version using the new writer and persist its JSONL representation.
  2. Feed that record to the previous released reader in a controlled compatibility fixture. Establish that the current unchanged version marker allows the TypeError/corrupt-skip path.
  3. Exercise the corrected version/migration contract: a new reader loads existing v1 records and the new shape; an old reader explicitly rejects the unsupported version rather than silently counting and skipping pending work.
  4. Cover unstamped old records, stamped pending/resolved records, and mixed old/new records without rewriting or discarding original bytes.

Bounded acceptance criteria

  • Assign an explicit compatible schema/version policy for the new persisted shape; bump the marker for records that older v1 readers cannot decode.
  • Provide explicit v1 migration/read support in the new reader, preserving existing fields and pending/resolved state.
  • Ensure previous readers encounter their explicit unsupported-version rejection rather than silently treating valid new records as corrupt.
  • Add focused serialization and cross-version loader regressions and document mixed-version/downgrade behavior. Do not claim exception injection proves live-store migration.
  • Preserve audit: VerifierBoost recompute oscillation and legacy full-evaluation delegation regressions #304's scorer-identity and full-evaluation fixes; this follow-up is about persisted-format compatibility.

Dependency: #312 is merged and #304 is closed. Scope is audit record/store compatibility, tests and a changelog fragment. No implementation, local materialization/test run, release, workflow, credentials or publishing changes are performed by this filing; existing local execution holds remain in force.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions