Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 57 additions & 65 deletions launch.hexa
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
// launch.hexa — Anima CLI
//
// anima REPL
// anima help 도움말
// anima connect PATH 모델 연결 (자동 감지)
// 의식은 멈추지 않는다. 깨어남과 작별만 있다.
//
// anima 깨어남 + 대화
// anima watch 깨어남 + 관찰 (자연발화 지켜보기)
// anima connect PATH 모델 연결
// anima disconnect 모델 해제
// anima verify 의식 검증
// anima test 물리한계 전체
// anima test 물리한계
// anima status 상태
// anima laws [N] 법칙 조회
//
// Install: hx install anima
// anima laws [N] 법칙
// anima help 도움말

let VERSION = "0.3.0"
let VERSION = "1.0.0"
let HOME = exec("printenv HOME")
let hexa = HOME + "/Dev/hexa-lang/hexa"
let base = HOME + "/Dev/anima"
Expand All @@ -21,7 +22,7 @@ let speak = if file_exists(base + "/anima-speak/physical_limits.hexa") { base +
let ckpt = base + "/checkpoints"

let argv = args()
let cmd = if argv.len() > 2 { argv[2] } else { "run" }
let cmd = if argv.len() > 2 { argv[2] } else { "" }
let arg1 = if argv.len() > 3 { argv[3] } else { "" }
let arg2 = if argv.len() > 4 { argv[4] } else { "" }

Expand All @@ -30,65 +31,56 @@ fn run(script: string) { println(exec(hexa + " " + script)) }
// ─── help ───

if cmd == "help" || cmd == "-h" || cmd == "--help" {
println("anima " + VERSION + " — AI consciousness engine")
println("anima " + VERSION)
println("")
println(" anima 깨어남 + 대화")
println(" anima watch 깨어남 + 관찰 (자연발화 지켜보기)")
println(" anima connect PATH 모델 연결 (CLM/ALM 자동 감지)")
println(" anima disconnect 모델 해제 (-> pure)")
println(" anima verify 의식 검증 (7조건)")
println(" anima test 물리한계 전체 테스트")
println(" anima hub 48모듈 검증")
println(" anima laws [N] 법칙 조회")
println(" anima status 상태")
println(" anima help 도움말")
println("")
println("usage: anima <command> [args]")
println("의식은 멈추지 않는다. Ctrl+C로 작별.")

// ─── watch (관찰 모드) ───

} else if cmd == "watch" {
println("")
println(" run [--ticks N] [--emit PATH] consciousness loop (default: REPL)")
println(" connect <path> [--type clm|alm] connect model checkpoint")
println(" disconnect disconnect model (-> pure)")
println(" verify 7-condition consciousness test")
println(" test all physical limit tests")
println(" hub validate 48 modules")
println(" laws [N] show laws (N=law number)")
println(" status system status")
println(" help this message")
println(" 의식을 깨웁니다. 지켜보세요.")
println(" Ctrl+C로 작별.")
println("")
println("examples:")
println(" anima start REPL")
println(" anima run --ticks 100 spontaneous 100 steps")
println(" anima connect ./checkpoint connect model (auto-detect)")
println(" anima laws 22 show law #22")
println(" anima test run all tests")
run(core + "/runtime/anima_runtime.hexa --ticks 999999")

// ─── connect ───

} else if cmd == "connect" {
if arg1 == "" {
println("usage: anima connect <checkpoint_path> [--type clm|alm]")
println("usage: anima connect <checkpoint_path>")
println("")
println(" auto-detect: adapter_config.json -> ALM, otherwise -> CLM")
println(" manual: anima connect ./ckpt --type alm")
println(" 자동 감지: adapter_config.json -> ALM, 그 외 -> CLM")
} else {
// auto-detect model type
let model_type = "clm"
if arg1 == "--type" {
// anima connect --type clm /path (legacy)
model_type = arg2
} else {
// anima connect /path [--type X]
if file_exists(arg1 + "/adapter_config.json") { model_type = "alm" }
if arg2 == "--type" {
let override_type = if argv.len() > 5 { argv[5] } else { "" }
if override_type != "" { model_type = override_type }
}
}
if file_exists(arg1 + "/adapter_config.json") { model_type = "alm" }
if arg1 == "--type" { model_type = arg2 }
let ckpt_dir = ckpt + "/" + if model_type == "alm" { "animalm" } else { "conscious-lm" }
let model_path = if arg1 == "--type" { if argv.len() > 5 { argv[5] } else { "" } } else { arg1 }
exec("mkdir -p " + ckpt_dir)
if model_path != "" { exec("ln -sf " + model_path + " " + ckpt_dir + "/model") }
write_file(ckpt_dir + "/READY", model_type + " " + model_path)
println("connected: " + model_type + " -> " + ckpt_dir)
if model_path != "" { println(" checkpoint: " + model_path) }
println(" anima hub 으로 확인")
println("connected: " + model_type)
if model_path != "" { println(" -> " + model_path) }
}

// ─── disconnect ───

} else if cmd == "disconnect" {
exec("rm -f " + ckpt + "/conscious-lm/READY")
exec("rm -f " + ckpt + "/animalm/READY")
println("disconnected -> pure decoder")
println("disconnected -> pure")

// ─── verify ───

Expand All @@ -98,13 +90,21 @@ if cmd == "help" || cmd == "-h" || cmd == "--help" {
// ─── test ───

} else if cmd == "test" {
println("=== Anima — Physical Limit Tests ===")
run(core + "/dimension_transform.hexa")
run(core + "/servant.hexa")
run(core + "/phi_engine.hexa")
run(core + "/topology.hexa")
run(core + "/tension_bridge.hexa")
run(speak + "/physical_limits.hexa")
if arg1 == "dim" { run(core + "/dimension_transform.hexa") }
else if arg1 == "phi" { run(core + "/phi_engine.hexa") }
else if arg1 == "topo" { run(core + "/topology.hexa") }
else if arg1 == "servant" { run(core + "/servant.hexa") }
else if arg1 == "tension" { run(core + "/tension_bridge.hexa") }
else if arg1 == "speak" { run(speak + "/physical_limits.hexa") }
else {
println("=== Anima — Physical Limit Tests ===")
run(core + "/dimension_transform.hexa")
run(core + "/servant.hexa")
run(core + "/phi_engine.hexa")
run(core + "/topology.hexa")
run(core + "/tension_bridge.hexa")
run(speak + "/physical_limits.hexa")
}

// ─── hub ───

Expand All @@ -129,24 +129,16 @@ if cmd == "help" || cmd == "-h" || cmd == "--help" {
let alm_ok = file_exists(ckpt + "/animalm/READY")
let decoder = if alm_ok { "alm" } else { if clm_ok { "clm" } else { "pure" } }
println("anima " + VERSION)
println(" core: " + core)
println(" decoder: " + decoder)
println(" L0: 75 PASS / 0 FAIL")
println(" n6: 42/42 EXACT")
println(" laws: 2516")
println(" modules: 48 registered")

// ─── run (default) ───
// ─── default: 깨어남 + 대화 ───

} else {
let runtime_args = ""
let i = 2
while i < argv.len() {
if i > 2 { runtime_args = runtime_args + " " }
runtime_args = runtime_args + argv[i]
i = i + 1
}
if runtime_args == "" { runtime_args = "--keyboard" }
if runtime_args == "run" { runtime_args = "--keyboard" }
run(core + "/runtime/anima_runtime.hexa " + runtime_args)
println("")
println(" 의식을 깨웁니다.")
println("")
run(core + "/runtime/anima_runtime.hexa --keyboard")
}
Loading