Commit Graph

2 Commits

Author SHA1 Message Date
marfrit 91187d2302 router: classify(line, config) -> (kind, payload)
Phase 0 implementation per PHASE0.md §5.

Pure function. Three kinds:
  "meta"  — line starts with ":", payload is the rest
  "shell" — line starts with "$" (override, $ stripped), OR first word
            is in config.shell.known_commands, OR first word is
            path-like (`./`, `../`, `/`)
  "ai"    — everything else (including empty / whitespace-only; the
            repl loop skips empty payloads before dispatching)

Path-like detection is deliberately conservative in Phase 0: anchored
prefixes only, no quoted-path or shell-glob handling. Q4 in §13 tracks
multi-command CMD: blocks; this router doesn't see those (it only
classifies user input lines, not assistant output).

Smoke covers all branches plus a nil-config fallthrough.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-10 12:05:25 +00:00
claude-noether 4310207738 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>
2026-05-09 23:16:07 +00:00