feat(tcs): complete native translator acceptance chain
This commit is contained in:
parent
2dc560d567
commit
fd15428c46
52 changed files with 4024 additions and 38 deletions
|
|
@ -15,7 +15,7 @@ fn run() -> Result<(), Box<dyn std::error::Error>> {
|
|||
let arguments: Vec<String> = env::args().skip(1).collect();
|
||||
match arguments.as_slice() {
|
||||
[command, source] if command == "parse" => {
|
||||
let text = fs::read_to_string(source)?;
|
||||
let text = tcs_stage0::read_tcs_source(Path::new(source))?;
|
||||
let document = tcs_stage0::parse(&text)?;
|
||||
println!("{}", serde_json::to_string_pretty(&document)?);
|
||||
Ok(())
|
||||
|
|
@ -26,7 +26,7 @@ fn run() -> Result<(), Box<dyn std::error::Error>> {
|
|||
Ok(())
|
||||
}
|
||||
[command, source, output] if command == "bootstrap-compiler" => {
|
||||
let source_text = fs::read_to_string(source)?;
|
||||
let source_text = tcs_stage0::read_tcs_source(Path::new(source))?;
|
||||
let compiler = tcs_stage0::bootstrap_compiler(&source_text)?;
|
||||
fs::write(output, tcs_stage0::canonical_json(&compiler)?)?;
|
||||
println!("BOOTSTRAPPED {source} -> {output}");
|
||||
|
|
@ -34,7 +34,7 @@ fn run() -> Result<(), Box<dyn std::error::Error>> {
|
|||
}
|
||||
[command, compiler, source, output] if command == "compile-with" => {
|
||||
let compiler: serde_json::Value = serde_json::from_str(&fs::read_to_string(compiler)?)?;
|
||||
let source_text = fs::read_to_string(source)?;
|
||||
let source_text = tcs_stage0::read_tcs_source(Path::new(source))?;
|
||||
let gir = tcs_stage0::compile_with_compiler_gir(&compiler, &source_text)?;
|
||||
fs::write(output, tcs_stage0::canonical_json(&gir)?)?;
|
||||
println!("TCS_COMPILED {source} -> {output}");
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ fn compiler_gir_tampering_and_negative_program_fail_closed() {
|
|||
fn tcs_compiler_source_controls_operation_policy_and_gir_lowering() {
|
||||
let compiler_source = compiler_source()
|
||||
.replace(
|
||||
"registered_operations = [\"CORE.ECHO\"]",
|
||||
"registered_operations = [\"CORE.ECHO\", \"CORE.TRANSLATOR_ADMISSION\", \"CORE.ZERO_CORE_EXECUTION\", \"CORE.HOST_PERSONA_PROBE\", \"CORE.DUAL_HOST_ACCEPTANCE\", \"CORE.AGENT_TRANSLATION_CANDIDATE\", \"CORE.AGENT_CANDIDATE_ACCEPTANCE\", \"CORE.CLIENT_CANDIDATE_ACCEPTANCE\", \"CORE.FINAL_TRANSLATOR_ACCEPTANCE\"]",
|
||||
"registered_operations = [\"ABSORB\"]",
|
||||
)
|
||||
.replace("to = \"exact_target\"", "to = \"policy_selected_target\"");
|
||||
|
|
|
|||
Loading…
Reference in a new issue