refactor(adapter): #286 5d-pre — type-carrying Indirection descriptor (no behavior change)#290
refactor(adapter): #286 5d-pre — type-carrying Indirection descriptor (no behavior change)#290avrabe wants to merge 1 commit into
Conversation
… (no behavior change) `collect_indirections` returned a flat `Vec<(offset, sub_elem_size, is_string)>` that treated `CVT::List(elem)` as ONE `is_string=false` leaf and DISCARDED the element type — so the emitter could never know an inner indirection is itself a pointer-bearing list needing recursion. That discard is the structural blocker for depth-N nested-string transcoding (#286 5d / list<list<string>>). Replace the tuple with a type-carrying descriptor: struct Indirection { offset, sub_elem_size, kind } enum IndirectionKind { String, List { elem: Box<ComponentValType> } } Indirection::is_string() == matches!(kind, String) // the former flag The `List { elem }` leaf now CARRIES the inner element WIT type — the 5d recursion seam. `elem` is `#[allow(dead_code)]` until 5d wires in the recursive copy (5d-pre is behaviour-preserving by construction). Updated all consumer sites to field access (offset/sub_elem_size kept as references so `*offset`/`*sub_elem_size` body reads are unchanged): - emit_patch_nested_indirections (result), emit_param_nested_indirections (param) - the 4 guard allow-predicate closures (.all(|ind| ind.is_string())) - lib.rs async result shim-stabilization deep-copy + its &[Indirection] param NO behaviour change: both list<list<string>> and list<list<u8>> still collect to a single List leaf with is_string()==false, so the guard's .all(is_string) predicate still rejects them and they stay fail-loud (SAFE) — exactly as before. Oracles: new unit test collect_indirections_carries_nested_list_element_type_5d_pre pins the descriptor (list<string> vs list<u8>, depth-1 vs depth-2) and READS the carried elem; full meld-core suite green (incl. 44 async_cross_encoding + 23 adapter_safety nested/SR-17 oracles); clippy -D warnings clean; fmt clean; LS-N gate green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Mythos delta-pass requiredThis PR modifies one or more Tier-5 source files (per Before merge, run the Mythos discover protocol on the
Why this gate exists: LS-A-10 The gate check on this PR will pass once the label is |
LS-N verification gate✅ 57/57 approved LS entries verified
Approved Failed LS entries(none) Missing regression tests(none) Updated automatically by |
Mythos delta-pass (auto)✅ NO FINDINGS across 1 Tier-5 file(s)
Auto-run via |
Status — pre-merge gatingRequired CI: Clippy / Format / LS-N (57/0/0) / Coverage / Detect-Tier-5 → all green. Non-blocking:
Merge is gated on the Mythos clean-room delta-pass (Tier-5 discipline). That adversarial pass is queued; the model API is transiently overloaded (529), so it will run on the next attempt. Inline pre-audit (compiler-verified complete under Not merging until the clean-room pass returns REFUTED. |
What & why
collect_indirectionsreturned a flatVec<(offset, sub_elem_size, is_string)>that treatedCVT::List(elem)as oneis_string=falseleaf and discarded the element type. That discard is the structural blocker for depth-N nested-string transcoding (#286 5d —list<list<string>>): the emitter can't recurse into an inner pointer-bearing list if the descriptor never told it the list's element type.This is 5d-pre: a behaviour-preserving descriptor redesign that carries the type, setting up 5d cleanly.
Change
All consumer sites moved to field access (
offset/sub_elem_sizekept as references so*offset/*sub_elem_sizebody reads are untouched):emit_patch_nested_indirections(result),emit_param_nested_indirections(param).all(|ind| ind.is_string())lib.rsasync result shim-stabilization deep-copy + its&[Indirection]paramNo behaviour change (the 5d-pre invariant)
Both
list<list<string>>andlist<list<u8>>still collect to a singleListleaf withis_string() == false, so the guard's.all(is_string)predicate still rejects them → they stay fail-loud (SAFE), exactly as before. 5d-pre only adds the carriedelem; it does not widen the allow-set.elemis#[allow(dead_code)]until 5d consumes it.Verification
collect_indirections_carries_nested_list_element_type_5d_prepins the descriptor (list<string>vslist<u8>, depth-1 vs depth-2) and reads the carriedelem, proving the type is genuinely carried.meld-coresuite green — incl. 44async_cross_encoding+ 23adapter_safetynested/SR-17 oracles (the behaviour-preservation oracle).clippy --all-targets -D warningsclean;fmtclean; LS-N gate 57/0/0.Scope
Tier-5 (
adapter/fact.rs,lib.rs) → Mythos clean-room delta-pass +mythos-pass-donelabel before merge.🤖 Generated with Claude Code