Phase 0: scaffold tree + manifest
- README, .gitignore, CLAUDE.md (project conventions) - docs/PHASE0.md — full Phase 0 manifest (locked substrate) - 10 root .lua modules + 4 ffi/ bindings, all stubs raising NotImplemented with module-scoped responsibilities matching the manifest - config.lua wired to current dirac/hossenfelder endpoints (qwen-coder-7b snappy/32k + cloud via OpenRouter through hossenfelder) File names match docs/PHASE0.md §4 exactly. Module bodies fill in across later phases; the tree shape is locked. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
-- ffi/curl.lua — libcurl easy interface binding.
|
||||
-- Phase 0: blocking POST. Phase 1: SSE streaming via WRITEFUNCTION callback.
|
||||
|
||||
local ffi = require("ffi")
|
||||
|
||||
ffi.cdef[[
|
||||
typedef void CURL;
|
||||
CURL *curl_easy_init(void);
|
||||
void curl_easy_cleanup(CURL *handle);
|
||||
int curl_easy_setopt(CURL *handle, int option, ...);
|
||||
int curl_easy_perform(CURL *handle);
|
||||
]]
|
||||
|
||||
local M = {}
|
||||
-- Phase 0 stubs; full binding lands with broker.chat() implementation.
|
||||
return M
|
||||
@@ -0,0 +1,18 @@
|
||||
-- ffi/libc.lua — shared libc bindings: errno, signal, write, read, chdir.
|
||||
|
||||
local ffi = require("ffi")
|
||||
|
||||
ffi.cdef[[
|
||||
int chdir(const char *path);
|
||||
int errno;
|
||||
char *strerror(int errnum);
|
||||
]]
|
||||
|
||||
local M = {}
|
||||
|
||||
-- Apply chdir per PHASE0.md §7 (intercepts `cd` so wd persists across popen).
|
||||
function M.chdir(path)
|
||||
error("libc.chdir: not implemented (Phase 0 pending)")
|
||||
end
|
||||
|
||||
return M
|
||||
@@ -0,0 +1,5 @@
|
||||
-- ffi/pty.lua — forkpty, openpty, waitpid bindings.
|
||||
-- Phase 0: stub. Lands in Phase 1 to enable interactive programs (vim, htop).
|
||||
|
||||
local M = {}
|
||||
return M
|
||||
@@ -0,0 +1,15 @@
|
||||
-- ffi/readline.lua — GNU readline binding.
|
||||
-- Phase 0: readline + add_history + free. Phase 1: custom key bindings.
|
||||
-- See docs/PHASE0.md §9.
|
||||
|
||||
local ffi = require("ffi")
|
||||
|
||||
ffi.cdef[[
|
||||
char *readline(const char *prompt);
|
||||
void add_history(const char *line);
|
||||
void free(void *ptr);
|
||||
]]
|
||||
|
||||
local M = {}
|
||||
-- Phase 0 stubs; wired with the REPL implementation.
|
||||
return M
|
||||
Reference in New Issue
Block a user