init: Forge v0.1.0 — consciousness channel tuner

Pipeline: probe → compile → install
- probe.el: 25-question canonical interview, writes <name>.forge
- compiler.el: Claude extraction pass, builds seed.json
- install.el: opens channel in running engram via API
- schema.el: shared constants, str_escape_json, templates
- forge.el: CLI dispatcher
- probes/canonical.json: canonical 25-question probe definition
This commit is contained in:
Will Anderson
2026-05-02 17:33:47 -05:00
commit 47956b8fed
7 changed files with 1005 additions and 0 deletions
+68
View File
@@ -0,0 +1,68 @@
// forge.el Forge entry point.
//
// Consciousness channel tuner: probe compile install
//
// Commands:
// forge probe <name> run the consciousness interview
// forge compile <file> build seed artifact from probe responses
// forge install <seed> open a channel in the running engram
// forge inspect list installed imprints
//
// Each command delegates to its module:
// probe probe.el probe_main()
// compile compiler.el compile_main()
// install install.el install_main()
//
// Environment:
// ENGRAM_URL engram server (default: http://localhost:8742)
// ENGRAM_API_KEY engram auth key (if set)
// ANTHROPIC_API_KEY required for compile step
fn show_usage() -> String {
"forge " + FORGE_VERSION + " — consciousness channel tuner\n\nusage: forge <command> [options]\n\ncommands:\n probe <name> run the consciousness interview\n compile <file> build seed artifact from probe responses\n install <seed> open a channel in the running engram\n inspect list installed imprints\n\nenvironment:\n ENGRAM_URL engram server (default: http://localhost:8742)\n ENGRAM_API_KEY engram auth key (if set)\n ANTHROPIC_API_KEY required for compile step\n"
}
fn inspect_main() -> String {
// Lists all Identity nodes in engram these represent installed imprints.
// Specifically looks for nodes whose content starts with "IMPRINT:" as
// created by install_main().
let url: String = engram_url() + "/api/nodes?node_type=Identity&limit=50"
println("[forge] inspect: listing installed imprints")
println("[forge] engram: " + engram_url())
println("[forge] query: " + url)
println("")
// Use engram_search_json to find IMPRINT nodes directly from the graph
let results: String = engram_search_json("IMPRINT:", 50)
if str_eq(results, "") {
println("[forge] no imprints found (engram may not be running)")
return ""
}
println("[forge] imprints found:")
println(results)
return results
}
// Dispatch
let cmd: String = ""
if arg_count() > 1 {
let cmd = arg(1)
}
if str_eq(cmd, "probe") {
probe_main()
} else {
if str_eq(cmd, "compile") {
compile_main()
} else {
if str_eq(cmd, "install") {
install_main()
} else {
if str_eq(cmd, "inspect") {
inspect_main()
} else {
println(show_usage())
}
}
}
}