Fix/base init test checkout path#20
Conversation
createMoaModel wraps N proposer models + 1 aggregator and conforms to the
existing LanguageModel port ({ id, complete, stream? }), so it drops in
anywhere a single model is expected.
Flow (Wang et al. 2024 MoA, the shape Hermes' `moa` provider uses):
proposers answer the same request in parallel with tools stripped (text
drafts only), then the aggregator synthesizes the drafts — folded into the
system message as private guidance — with the original tools intact so
tool-calling still works through it. Usage is summed across all models.
No ground-truth judge exists in chat, so the aggregator LLM is the selector,
matching Hermes' design. Resilient to partial proposer failures; throws only
if every proposer fails.
Tested with faux/stub models (no API keys): synthesis, tool-stripping,
partial-failure resilience, usage summation, config validation, streaming.
feat(base-llm): Mixture-of-Agents meta-model
createTriumviratModel implements the inference-time architecture of Sakana Fugu / TRINITY (arXiv:2512.04695). The name nods to the three roles it coordinates. Each turn a coordinator picks a model from a swappable pool and assigns it a role (Thinker plans, Worker executes and is the only role given tools, Verifier judges the draft and gates termination), looping until accepted or a turn budget hits. TRINITY's contribution is a CMA-ES-trained 0.6B coordinator, which can't be reproduced as a PR, so the default coordinator is prompted (an LLM choosing model+role+stop) with a deterministic Thinker->Worker->Verifier fallback. The coordinator.decide seam lets a heuristic or trained coordinator drop in later with no API change. Conforms to the LanguageModel port, sums usage, threads the abort signal, recovers from failed role turns. Tested with stub models (no keys): happy path, reject-then-fix feedback, budget exhaustion, tool routing, usage summation, prompted-coordinator JSON path, deterministic fallback, role-failure recovery, abort, config validation.
Add an `ensembles` block to .ai/studio.settings.json so MoA and Triumvirat are configurable without code. resolveModel checks ensembles before the provider path: an ensemble entry names a type (moa | triumvirat) plus member refs, and each member resolves through the existing <provider>/<model> registry, so the ensemble name then works anywhere a model ref does. Bad config (missing aggregator/pool, unknown type, unknown provider member) fails with a clear BAD_REQUEST. Tests cover both ensemble types, a plain provider ref regression, and each error path. Docs with a resolution diagram.
createLangfuseModel wraps any base-llm model and conforms to the same port
({ id, complete, stream? }), so it composes over a single adapter, a MoA, or
a Triumvirat. Every call is traced to Langfuse: input, output, token usage,
latency, and errors.
Zero new dependencies: no Langfuse SDK, just native fetch against the public
ingestion API (POST /api/public/ingestion, HTTP Basic auth). Ingestion is
fire-and-forget so it never adds latency; flush() drains in-flight sends.
A telemetry failure never breaks the wrapped call (routed to onError).
Keys default to env LANGFUSE_PUBLIC_KEY / LANGFUSE_SECRET_KEY; self-hosted
via LANGFUSE_HOST. Tested with a fake fetch (no network): trace+generation
emission, usage mapping, error traces, ingestion-failure resilience, env
keys, streaming capture, config validation. Docs with a mermaid sequence
diagram.
- packages/base-llm/README.md: a Composition section linking the MoA, Triumvirat, ensembles-settings and Langfuse docs so they are discoverable from the package root. - docs/reference/orchestration-et-supervision.md: a French reference page (authoritative) for the docs site, plus its English mirror under docs/en. Present-tense, em-dash-free, lexicon/translation/tree gates green. Makes the new capabilities visible on the default branch and in the rendered manual once merged.
Orchestration + monitoring: Triumvirat, ensembles, Langfuse, docs
… pass - Register de (Deutsch) and it (Italiano) locales in the docs-site config. - Translate all 74 French reference pages to German and Italian under docs/de/ and docs/it/, each a body-only mirror with a fr-synced hash that matches its French source (the gate that keeps translations from drifting). - Add mermaid diagrams to the French pages that genuinely describe a flow, decision tree, or lifecycle (routing voies, provider selection, adoption, expertise lifecycle, ...), mirrored into en/de/it. All doc gates pass: em-dash, statusless, punctuation, lexicon, translations, tree. German targets the Swiss German-speaking audience; Italian is natural. Machine-assisted, so a native review pass is worthwhile before publishing.
docs(i18n): German + Italian translations of all 74 pages + mermaid
The CLI init test asserted the framework directory's name
(endsWith('/base') or includes('Repositories')), which encoded the
maintainer's local checkout and failed on any clone in a differently
named directory (forks, CI scratch dirs, base-repo, ...).
base init is correct: it records framework_dir as the framework root
resolved from the CLI's own location. Assert that invariant instead:
framework_dir == path.dirname(path.dirname(cliPath)).
Full suite now 866/866 (this was the only failing test). Closes #8.
|
Bonjour Maxime, et merci pour ce correctif. Sur le fond, la correction vise juste: l'assertion actuelle ( Un élément nouveau depuis votre envoi, à intégrer au correctif: en 1.1.0, Le reste du cadrage tient toujours: la branche n'est pas partie d'un
Ainsi scopée, rebasée et signée, la correction passera sans friction. Merci encore, et bravo pour le reste du travail: on en reparle dans #17 et #18. |
Summary
Type
Checklist
npm testgreen (core + packages)npm run typecheckcleannode tools/base.mjs validate --root .→ "BASE valide."node tools/base.mjs route-test --root .stable (and the example fixtures, if routing changed)npm run index,base build --write)cd mcp && npm run build && npm test(the build runstsc; vitest alone does not type-check)cd tools/studio/ui && npm test && npm run build(andnpm run e2efor user flows)