Skip to content

avro: differential codec probe — ask the codec which slot a field lands in, instead of guessing from names #100

Open

Description

@kryptt

#98 resolves .field(_.x) to a schema field by NAME when the codec names the whole case-field list onto distinct schema fields, else by declaration POSITION. Three codec shapes are still resolved to the wrong field, and no amount of name matching can reach them, because the names carry no recoverable signal at all: a field list that both renames beyond recognition AND reorders ({beta_name, alpha_name} vs {alpha, beta} — equal arity, no name hit); two same-physical-type columns renamed and reversed (Ev(occurredAt: Long, seqNo: Long) against {seq_no, event_ts}, where a timestamp-millis logical type annotates the same physical long and so does not disambiguate); and compensating arity, where one case field is dropped and one computed column added so the counts agree while position shifts. All three are pinned as executable known limitations in avro/src/test/scala/dev/constructive/eo/avro/vulcan/ResolutionResidualSpec.scala (cells 5a, b2, b6). The mechanism that reaches them is a DIFFERENTIAL PROBE of the codec itself: at prism construction, encode two sentinel values through codec.encode, diff the resulting slots, and observe which schema field a given case field actually lands in. It needs no user declaration and no name heuristics, it is ground truth rather than inference, and it would additionally turn a wrong hand-written field mapping from believed into refused. Medium effort — the hard part is sentinel synthesis across the Avro type space (records, unions, enums, fixed, logical types, defaults) — and it MUST degrade to the existing name/position rule rather than refuse when a sentinel cannot be synthesised, so it never becomes a new false-positive surface.

Residual-cell evidence and the full 66-cell corruption matrix: /tmp/claude-1000/-home-rhansen-workspace-constructive-dev-eo/f9d50161-f717-4239-9f84-d7f5c596bbe3/scratchpad/hazard/attack-bypass/evidence/02-ladder-bypass.tsv and .../hazard/matrix/evidence/00-MATRIX.tsv. Decision memo: .../scratchpad/HAZARD-MEMO.md §3.

Filed as a follow-up to #95 / #98.

🤖 Generated with Claude Code

https://claude.ai/code/session_0194EHFR4NamCpTHiqy7B74V

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions