feat: foundations — canonical types, Parse grammar, env DSNs, health, chains

Phase 1 of the majordomo build:
- llm/ canonical contract (messages, parts, tools, capabilities, streaming,
  Model/Provider, error classification)
- health/ clock-injected tracker (threshold bench, exponential capped
  cooldown, reset-on-success)
- root Registry + Parse (verbatim model ids, inline recursive alias
  expansion with cycle detection, chain dedup), LLM_* env-DSN providers
  (go-llm parity: lazy fallback + eager LoadEnv), health-aware chain
  executor behind the Model interface
- provider/fake scriptable test provider; hermetic test suite incl. the
  trailing-thinking chain and foreman:// env loading
- ADRs 0001-0008, CLAUDE.md, README (honest matrix), CI workflow,
  docs/phase-1-design.md

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-06-10 12:35:23 +02:00
parent 3025044817
commit dcd004289f
42 changed files with 3863 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
// Package llm defines majordomo's canonical, provider-agnostic contract:
// messages and content parts, requests and responses, tools, capabilities,
// streaming, and the Model/Provider interfaces every backend implements.
//
// Why: provider implementations (openai, anthropic, google, ollama, foreman,
// and any client-defined backend) must share one vocabulary without importing
// each other or the root package. This package is the dependency leaf — it
// imports nothing else in the module, and everything else imports it.
//
// Most consumers never import this package directly: the root majordomo
// package re-exports every type here via type aliases.
package llm