iter embedding-abi-m1.1 (PARTIAL 3/7): schema + surface + baseline prerequisites; plan Repair

Tasks 1-3 of docs/plans/embedding-abi-m1.1.md, a verified known-good
subset (cargo build --workspace exit 0; full workspace green; the
roundtrip_cli all-examples gate green):

- Task 1: CLI build-path MissingEntryMain baseline pin
  (examples/embed_noentry_baseline.ail + embed_missing_main_baseline.rs;
  triple-assertion, layered on the green codegen-unit pin lib.rs:3314).
- Task 2: additive FnDef.export: Option<String> (serde default +
  skip_serializing_if, modelled on FnDef.doc); compile-driven thread
  of export: None across ~85 FnDef/AstFnDef literals / 18 files incl.
  all in-source #[cfg(test)] mod tests + drift/hash/spec-drift
  literals + the codegen lib.rs:3320 in-source pin; hash-stability
  golden pin; DESIGN.md fn-JSON "export" line. DONE_WITH_CONCERNS
  (plan symbol content_hash_fn -> def_hash per hash_pin.rs, plan-
  pseudo-vs-reality class, plan corrected).
- Task 3: Form-A (export "<sym>") modifier — parse_export +
  parse_fn thread + write_fn_def emission + form_a.md grammar;
  byte-identical round-trip.

Task 4 BLOCKED (Boss plan-defect: fixtures declared module != file
stem; AILang's loader hard-enforces module==stem at workspace.rs:438,
so ail check panicked on load before the gate). Boss resolution
(Option 2, overriding the orchestrator's Option 1, rationale in the
journal + plan Design-decision 6): keep descriptive embed_* filenames,
rename fixture MODULES to their stems — the C symbol backtest_step
stays via (export ...), demonstrating spec Decision 2's mangling-
decoupling rather than violating it; archive becomes
libembed_backtest_step.a, internal symbol @ail_embed_backtest_step_step,
host.c unchanged. Plan fixed (Design-decision 6 + Task-4 module==stem
+ Task-5/6/7 dependent strings + the no-*. Float-head + content_hash_fn
concerns folded). Headline fixture corrected; blocked-Task-4 WIP
discarded (recreated by the [4,7] re-dispatch from the fixed plan).

PARTIAL commit (not the iter's final commit): the implement Repair
path mandates committing the known-good subset so the [4,7]
re-dispatch starts from a clean tree that includes Tasks 1-3 (Tasks
4-7 structurally depend on the schema field + surface). INDEX line
added when the full iter lands post-re-dispatch.
This commit is contained in:
2026-05-18 14:32:39 +02:00
parent 123ae1be5c
commit 818177d835
27 changed files with 709 additions and 38 deletions
+32
View File
@@ -3168,6 +3168,7 @@ mod tests {
},
suppress: vec![],
doc: None,
export: None,
}),
// Entry module needs a `main`, otherwise
// `lower_workspace` returns `MissingEntryMain`.
@@ -3184,6 +3185,7 @@ mod tests {
body: Term::Lit { lit: Literal::Unit },
suppress: vec![],
doc: None,
export: None,
}),
],
};
@@ -3248,6 +3250,7 @@ mod tests {
},
suppress: vec![],
doc: None,
export: None,
}),
],
};
@@ -3299,6 +3302,7 @@ mod tests {
},
suppress: vec![],
doc: None,
export: None,
})],
};
let err = emit_ir(&m).expect_err(
@@ -3332,6 +3336,7 @@ mod tests {
},
suppress: vec![],
doc: None,
export: None,
})],
};
let err = emit_ir(&m).unwrap_err();
@@ -3402,6 +3407,7 @@ mod tests {
body: Term::Lit { lit: Literal::Unit },
suppress: vec![],
doc: None,
export: None,
}),
],
};
@@ -3471,6 +3477,7 @@ mod tests {
body: Term::Lit { lit: Literal::Unit },
suppress: vec![],
doc: None,
export: None,
}),
],
};
@@ -3502,6 +3509,7 @@ mod tests {
body,
suppress: vec![],
doc: None,
export: None,
})
}
let plus_int = Term::App {
@@ -3562,6 +3570,7 @@ mod tests {
body,
suppress: vec![],
doc: None,
export: None,
})
}
fn cmp(op: &str, a: Term, b: Term) -> Term {
@@ -3583,6 +3592,7 @@ mod tests {
},
params: vec![], body: Term::Lit { lit: Literal::Unit },
suppress: vec![], doc: None,
export: None,
});
let m = Module {
schema: ailang_core::SCHEMA.to_string(),
@@ -3624,6 +3634,7 @@ mod tests {
param_modes: vec![], ret_mode: ParamMode::Implicit,
},
params: vec![], body, suppress: vec![], doc: None,
export: None,
})
}
fn app1(callee: &str, arg: Term) -> Term {
@@ -3674,6 +3685,7 @@ mod tests {
param_modes: vec![], ret_mode: ParamMode::Implicit,
},
params: vec![], body, suppress: vec![], doc: None,
export: None,
})
}
let main_def = Def::Fn(FnDef {
@@ -3684,6 +3696,7 @@ mod tests {
},
params: vec![], body: Term::Lit { lit: Literal::Unit },
suppress: vec![], doc: None,
export: None,
});
let m = Module {
schema: ailang_core::SCHEMA.to_string(),
@@ -3731,6 +3744,7 @@ mod tests {
body: Term::Lit { lit: Literal::Bool { value: false } },
suppress: vec![],
doc: None,
export: None,
}),
Def::Fn(FnDef {
name: "main".into(),
@@ -3745,6 +3759,7 @@ mod tests {
body: Term::Lit { lit: Literal::Unit },
suppress: vec![],
doc: None,
export: None,
}),
],
};
@@ -3788,6 +3803,7 @@ mod tests {
body: Term::Lit { lit: Literal::Bool { value: false } },
suppress: vec![],
doc: None,
export: None,
}),
Def::Fn(FnDef {
name: "main".into(),
@@ -3802,6 +3818,7 @@ mod tests {
body: Term::Lit { lit: Literal::Unit },
suppress: vec![],
doc: None,
export: None,
}),
],
};
@@ -3849,6 +3866,7 @@ mod tests {
body: Term::Lit { lit: Literal::Unit },
suppress: vec![],
doc: None,
export: None,
})],
};
let ir = emit_ir(&m).unwrap();
@@ -3947,6 +3965,7 @@ mod tests {
body: Term::Lit { lit: Literal::Unit }, // placeholder; intercept overrides
suppress: vec![],
doc: None,
export: None,
});
let main_def = Def::Fn(FnDef {
name: "main".into(),
@@ -3961,6 +3980,7 @@ mod tests {
body: Term::Lit { lit: Literal::Unit },
suppress: vec![],
doc: None,
export: None,
});
Module {
schema: SCHEMA.into(),
@@ -4003,6 +4023,7 @@ mod tests {
body: Term::Lit { lit: Literal::Unit },
suppress: vec![],
doc: None,
export: None,
}),
],
};
@@ -4041,6 +4062,7 @@ mod tests {
},
suppress: vec![],
doc: None,
export: None,
})],
};
let ir = emit_ir(&m).unwrap();
@@ -4077,6 +4099,7 @@ mod tests {
},
suppress: vec![],
doc: None,
export: None,
})],
};
let ir = emit_ir(&m).unwrap();
@@ -4113,6 +4136,7 @@ mod tests {
body: Term::Lit { lit: Literal::Bool { value: false } },
suppress: vec![],
doc: None,
export: None,
}),
Def::Fn(FnDef {
name: "main".into(),
@@ -4127,6 +4151,7 @@ mod tests {
body: Term::Lit { lit: Literal::Unit },
suppress: vec![],
doc: None,
export: None,
}),
],
};
@@ -4208,6 +4233,7 @@ mod tests {
},
suppress: vec![],
doc: None,
export: None,
}),
Def::Fn(FnDef {
name: "main".into(),
@@ -4222,6 +4248,7 @@ mod tests {
body: Term::Lit { lit: Literal::Unit },
suppress: vec![],
doc: None,
export: None,
}),
],
};
@@ -4272,6 +4299,7 @@ mod tests {
},
suppress: vec![],
doc: None,
export: None,
})],
};
let ir = emit_ir(&m).unwrap();
@@ -4311,6 +4339,7 @@ mod tests {
},
suppress: vec![],
doc: None,
export: None,
})],
};
let ir = emit_ir(&m).unwrap();
@@ -4351,6 +4380,7 @@ mod tests {
},
suppress: vec![],
doc: None,
export: None,
})],
};
let ir = emit_ir(&m).unwrap();
@@ -4391,6 +4421,7 @@ mod tests {
},
suppress: vec![],
doc: None,
export: None,
})],
};
let ir = emit_ir(&m).unwrap();
@@ -4434,6 +4465,7 @@ mod tests {
},
suppress: vec![],
doc: None,
export: None,
})],
};
let ir = emit_ir(&m).unwrap();