hv1 verify: add direct route (env JSON) and clean inline path; fix v1 phi incoming order; make test_runner use hv1 direct; add phase2037 phi canaries; load modules.workspace exports for alias; update docs (phase-20.38, source extensions) and CURRENT_TASK
This commit is contained in:
@ -156,6 +156,29 @@ impl MirInterpreter {
|
||||
name if name == "env.get" || name.starts_with("env.get/") || name.contains("env.get") => {
|
||||
return self.execute_extern_function("env.get", args);
|
||||
}
|
||||
// Minimal bridge for Hako static provider: HakoruneExternProviderBox.get(name, arg)
|
||||
// Purpose: allow -c/inline alias path to tolerate static box calls without unresolved errors.
|
||||
// Behavior: when HAKO_V1_EXTERN_PROVIDER_C_ABI=1, emit stable tag; always return empty string.
|
||||
name if name == "HakoruneExternProviderBox.get"
|
||||
|| name.starts_with("HakoruneExternProviderBox.get/")
|
||||
|| name.contains("HakoruneExternProviderBox.get") =>
|
||||
{
|
||||
// Read provider name from first arg if available
|
||||
let mut prov: Option<String> = None;
|
||||
if let Some(a0) = args.get(0) {
|
||||
if let Ok(v) = self.reg_load(*a0) { prov = Some(v.to_string()); }
|
||||
}
|
||||
if std::env::var("HAKO_V1_EXTERN_PROVIDER_C_ABI").ok().as_deref() == Some("1") {
|
||||
if let Some(p) = prov.as_deref() {
|
||||
match p {
|
||||
"env.mirbuilder.emit" => eprintln!("[extern/c-abi:mirbuilder.emit]"),
|
||||
"env.codegen.emit_object" => eprintln!("[extern/c-abi:codegen.emit_object]"),
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
}
|
||||
return Ok(VMValue::String(String::new()));
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
||||
|
||||
@ -26,14 +26,28 @@ impl MirInterpreter {
|
||||
args: &[ValueId],
|
||||
) -> Option<Result<VMValue, VMError>> {
|
||||
match extern_name {
|
||||
// Console/print family (minimal)
|
||||
// Console family (minimal)
|
||||
"nyash.console.log" | "env.console.log" | "print" | "nyash.builtin.print" => {
|
||||
let s = if let Some(a0) = args.get(0) { self.reg_load(*a0).ok() } else { None };
|
||||
if let Some(v) = s { println!("{}", v.to_string()); } else { println!(""); }
|
||||
Some(Ok(VMValue::Void))
|
||||
}
|
||||
"env.console.warn" | "nyash.console.warn" => {
|
||||
let s = if let Some(a0) = args.get(0) { self.reg_load(*a0).ok() } else { None };
|
||||
if let Some(v) = s { eprintln!("[warn] {}", v.to_string()); } else { eprintln!("[warn]"); }
|
||||
Some(Ok(VMValue::Void))
|
||||
}
|
||||
"env.console.error" | "nyash.console.error" => {
|
||||
let s = if let Some(a0) = args.get(0) { self.reg_load(*a0).ok() } else { None };
|
||||
if let Some(v) = s { eprintln!("[error] {}", v.to_string()); } else { eprintln!("[error]"); }
|
||||
Some(Ok(VMValue::Void))
|
||||
}
|
||||
// Extern providers (env.mirbuilder / env.codegen)
|
||||
"env.mirbuilder.emit" => {
|
||||
// Guarded stub path for verify/Hakorune-primary bring-up
|
||||
if std::env::var("HAKO_V1_EXTERN_PROVIDER").ok().as_deref() == Some("1") {
|
||||
return Some(Ok(VMValue::String(String::new())));
|
||||
}
|
||||
if args.is_empty() { return Some(Err(VMError::InvalidInstruction("env.mirbuilder.emit expects 1 arg".into()))); }
|
||||
let program_json = match self.reg_load(args[0]) { Ok(v) => v.to_string(), Err(e) => return Some(Err(e)) };
|
||||
let res = match crate::host_providers::mir_builder::program_json_to_mir_json(&program_json) {
|
||||
@ -43,6 +57,10 @@ impl MirInterpreter {
|
||||
Some(res)
|
||||
}
|
||||
"env.codegen.emit_object" => {
|
||||
// Guarded stub path for verify/Hakorune-primary bring-up
|
||||
if std::env::var("HAKO_V1_EXTERN_PROVIDER").ok().as_deref() == Some("1") {
|
||||
return Some(Ok(VMValue::String(String::new())));
|
||||
}
|
||||
if args.is_empty() { return Some(Err(VMError::InvalidInstruction("env.codegen.emit_object expects 1 arg".into()))); }
|
||||
let mir_json = match self.reg_load(args[0]) { Ok(v) => v.to_string(), Err(e) => return Some(Err(e)) };
|
||||
let opts = crate::host_providers::llvm_codegen::Opts {
|
||||
|
||||
Reference in New Issue
Block a user