Multi-profile engine architecture + ADR-0014 #128

Closed
opened 2026-10-23 10:12:43 +02:00 by AlexKucera · 5 comments
Owner

Part of #125

Question

The multi-profile engine's shape, recorded as ADR-0014 (+ the PRD/ADR amendments it forces): which profiles exist (surface inventory from #126 feeds this) and their naming; provisioning ×N (ProfileProvisioner parameterized — profile create, additive skill seeding, and museion-tools registration per profile per ADR-0008); engine lifecycle per surface (resident engine for chat, on-demand spawn for one-shot passes, teardown + respawn on model switch); the Settings→profile write path (hermes CLI vs direct config.yaml/.env edit — and what restarts when it changes); model-dropdown sourcing (hermes model registry vs provider /models — factsheet has the endpoints and shapes); GLM reasoning_effort + output budget surfaced per profile (bench-validated dials: effort = 20s vs 194s per pass, 7× cost; budget ≥24k). Streaming posture is NOT at stake — the #131 probe settled that both channels stream live through hermes. Consumes the provider factsheet (#127).

[Generated by AI]

Part of #125 ## Question The multi-profile engine's shape, recorded as ADR-0014 (+ the PRD/ADR amendments it forces): which profiles exist (surface inventory from #126 feeds this) and their naming; provisioning ×N (ProfileProvisioner parameterized — profile create, additive skill seeding, and museion-tools registration per profile per ADR-0008); engine lifecycle per surface (resident engine for chat, on-demand spawn for one-shot passes, teardown + respawn on model switch); the Settings→profile write path (hermes CLI vs direct config.yaml/.env edit — and what restarts when it changes); model-dropdown sourcing (hermes model registry vs provider /models — factsheet has the endpoints and shapes); GLM reasoning_effort + output budget surfaced per profile (bench-validated dials: effort = 20s vs 194s per pass, 7× cost; budget ≥24k). Streaming posture is NOT at stake — the #131 probe settled that both channels stream live through hermes. Consumes the provider factsheet (#127). [Generated by AI]
AlexKucera added the wayfinder:grillingwayfinder:grilling labels 2026-10-23 10:12:43 +02:00
AlexKucera added a new dependency 2026-10-23 10:12:57 +02:00
AlexKucera added a new dependency 2026-10-23 10:12:59 +02:00
Author
Owner

Unblocked by #127's factsheet — docs/research/native-llm-providers.md, branch research/native-llm-providers @ d12463b (local, push pending authorization). Constraints that bound this ticket's round, wire-verified 2026-10-23:

  1. OpenAI: /v1/chat/completions rejects function tools combined with reasoning_effort ≠ none (400 names /v1/responses as the alternative) — typed-tool reasoning passes on OpenAI need the Responses API, or run non-reasoning.
  2. Anthropic 5.x: thinking:{type:adaptive} + output_config.effort (low/medium/high/xhigh/max); the old enabled/budget_tokens shape 400s. Forced tool_choice (tool/any) is removed — auto only — so the fix-card submit contract is prompt-enforced, never tool-forced. Thinking streams as thinking_delta + signature_delta; tool args arrive as incremental input_json_delta fragments.
  3. z.ai: content arrives as an end-of-turn flush on BOTH endpoint families — only reasoning_content streams live. Budget rule: thinking counts inside max_tokens, default ≥24k for passes. Coding-plan keys are distribution-restricted (supported-tools clause) — standard PAAS keys are the path for shipped Museion; coding plan stays maintainer-dogfood.

[Generated by AI]

Unblocked by #127's factsheet — `docs/research/native-llm-providers.md`, branch `research/native-llm-providers` @ d12463b (local, push pending authorization). Constraints that bound this ticket's round, wire-verified 2026-10-23: 1. **OpenAI**: /v1/chat/completions rejects function tools combined with reasoning_effort ≠ none (400 names /v1/responses as the alternative) — typed-tool reasoning passes on OpenAI need the Responses API, or run non-reasoning. 2. **Anthropic 5.x**: `thinking:{type:adaptive}` + `output_config.effort` (low/medium/high/xhigh/max); the old enabled/budget_tokens shape 400s. Forced tool_choice (tool/any) is removed — auto only — so the fix-card submit contract is prompt-enforced, never tool-forced. Thinking streams as thinking_delta + signature_delta; tool args arrive as incremental input_json_delta fragments. 3. **z.ai**: content arrives as an end-of-turn flush on BOTH endpoint families — only reasoning_content streams live. Budget rule: thinking counts inside max_tokens, default ≥24k for passes. Coding-plan keys are distribution-restricted (supported-tools clause) — standard PAAS keys are the path for shipped Museion; coding plan stays maintainer-dogfood. [Generated by AI]
AlexKucera changed title from Native engine architecture + ADR-0014 to Multi-profile engine architecture + ADR-0014 2026-10-23 10:55:47 +02:00
Author
Owner

Correction to constraint 3 in this ticket's earlier pointer comment: the chunk-timing re-probe (#131) falsified the z.ai content-flush claim — content streams live in ≤15-char chunks starting the moment thinking ends; the "flush" was tps arithmetic (reasoning-inclusive out_tok divided by the content window). Factsheet corrected at research/native-llm-providers @ 49a121c. Constraint 3 is void; constraints 1 (OpenAI tools × reasoning_effort) and 2 (Anthropic 5.x adaptive thinking, no forced tool_choice) stand and now apply to whichever hermes profiles use those providers.

[Generated by AI]

Correction to constraint 3 in this ticket's earlier pointer comment: the chunk-timing re-probe (#131) falsified the z.ai content-flush claim — content streams live in ≤15-char chunks starting the moment thinking ends; the "flush" was tps arithmetic (reasoning-inclusive out_tok divided by the content window). Factsheet corrected at `research/native-llm-providers` @ 49a121c. **Constraint 3 is void; constraints 1 (OpenAI tools × reasoning_effort) and 2 (Anthropic 5.x adaptive thinking, no forced tool_choice) stand** and now apply to whichever hermes profiles use those providers. [Generated by AI]
AlexKucera self-assigned this 2026-10-23 11:28:20 +02:00
Author
Owner

Resolution (2026-10-23, grilling — all four recommendations confirmed, plus one live correction)

Provisioning ×N — explicit copy after create. Fresh pass profiles get their model block by reading hermes -p museion config get model and writing each key via hermes -p <profile> config set … (probed on a throwaway profile: profile create inherits the model block from the ACTIVE profile — wrong source — and .env never inherits). Keys fan out to .env explicitly per #126. Skills seed ×3 (same payload, additive-only), museion-tools registers ×3 (ADR-0008 amended to per-surface).

Engine lifecycle — on-demand pass engines. Chat keeps its resident engine (existing MentorSessionModel). Passes spawn hermes acp -p museion-passN at Run Pass and tear down at verdict: fresh spawn always reads current config, so a model switch costs nothing for passes (next spawn picks it up) and the chat engine uses its existing restart flow. Chat + passes run concurrently on separate profiles.

Settings write path — hermes CLI for config, direct .env edit for keys. hermes -p X config set model.default|base_url|reasoning_effort — validated keys, _config_version bump, format owned by hermes (all verified live). No CLI exists for .env values; keys are a plain file write per matching profile. The 24k budget writes once at provisioning (extra_body.max_tokens, --force) — not a Settings control.

Model dropdown — hermes' own registry. Sources ~/.hermes/provider_models_cache.json (per-provider live /v1/models lists, the hermes model picker cache) with a free-text combo fallback. Zero HTTP from the app.

Reasoning effort — live correction from the human: dropdowns for ALL three providers, not GLM-only. zai low/high/max · OpenAI low/medium/high/xhigh/max · Anthropic low/medium/high/xhigh/max — one key (model.reasoning_effort); hermes' canonical ladder clamps to each route's wire vocabulary (verified in source: agent/reasoning_effort.py — EFFORT_LADDER + clamp_effort, never escalates). Map Notes item 4 amended accordingly.

Folded, no veto: pass transcript + roster behavior unchanged under the engine swap; profile backup (G4/S2.6) widens to all three profiles — pass-history transcripts are engine-owned (ADR-0007) and not reprovisionable; Sessions keeps riding Chat's profile.

Landed: merged to main @ b11dd30 (branch adr/0014-profiles-per-surface, ADR commit ba05392) — docs/adr/0014-one-hermes-profile-per-llm-surface.md new; PRD amended (G1/G3/G3a/G4, Model/provider, S2.1/S2.2/S2.4/S2.6, risk 7); ADR-0008 registration widened per profile; CONTEXT.md carries #126's LLM Surface glossary; docs/AGENTS.md ADR range updated.

Feeds: #129 (provisioning mechanics settled), #130 (dropdown sourcing, effort vocabularies, CLI write path settled), #132 (defaults remain bench-grounded; effort vocabulary now three-provider).

[Generated by AI]

## Resolution (2026-10-23, grilling — all four recommendations confirmed, plus one live correction) **Provisioning ×N — explicit copy after create.** Fresh pass profiles get their model block by reading `hermes -p museion config get model` and writing each key via `hermes -p <profile> config set …` (probed on a throwaway profile: `profile create` inherits the model block from the **ACTIVE** profile — wrong source — and `.env` never inherits). Keys fan out to `.env` explicitly per #126. Skills seed ×3 (same payload, additive-only), museion-tools registers ×3 (ADR-0008 amended to per-surface). **Engine lifecycle — on-demand pass engines.** Chat keeps its resident engine (existing MentorSessionModel). Passes spawn `hermes acp -p museion-passN` at Run Pass and tear down at verdict: fresh spawn always reads current config, so a model switch costs nothing for passes (next spawn picks it up) and the chat engine uses its existing restart flow. Chat + passes run concurrently on separate profiles. **Settings write path — hermes CLI for config, direct `.env` edit for keys.** `hermes -p X config set model.default|base_url|reasoning_effort` — validated keys, `_config_version` bump, format owned by hermes (all verified live). No CLI exists for `.env` values; keys are a plain file write per matching profile. The 24k budget writes once at provisioning (`extra_body.max_tokens`, `--force`) — not a Settings control. **Model dropdown — hermes' own registry.** Sources `~/.hermes/provider_models_cache.json` (per-provider live `/v1/models` lists, the `hermes model` picker cache) with a free-text combo fallback. Zero HTTP from the app. **Reasoning effort — live correction from the human: dropdowns for ALL three providers, not GLM-only.** zai low/high/max · OpenAI low/medium/high/xhigh/max · Anthropic low/medium/high/xhigh/max — one key (`model.reasoning_effort`); hermes' canonical ladder clamps to each route's wire vocabulary (verified in source: `agent/reasoning_effort.py` — `EFFORT_LADDER` + `clamp_effort`, never escalates). Map Notes item 4 amended accordingly. **Folded, no veto:** pass transcript + roster behavior unchanged under the engine swap; profile backup (G4/S2.6) widens to all three profiles — pass-history transcripts are engine-owned (ADR-0007) and not reprovisionable; Sessions keeps riding Chat's profile. **Landed:** merged to main @ b11dd30 (branch `adr/0014-profiles-per-surface`, ADR commit ba05392) — `docs/adr/0014-one-hermes-profile-per-llm-surface.md` new; PRD amended (G1/G3/G3a/G4, Model/provider, S2.1/S2.2/S2.4/S2.6, risk 7); ADR-0008 registration widened per profile; CONTEXT.md carries #126's LLM Surface glossary; docs/AGENTS.md ADR range updated. Feeds: #129 (provisioning mechanics settled), #130 (dropdown sourcing, effort vocabularies, CLI write path settled), #132 (defaults remain bench-grounded; effort vocabulary now three-provider). [Generated by AI]
Author
Owner

Amended by #133 (resolution: #133 (comment)): skills are no longer same-payload ×3 — per-surface curation with one master copy symlinked per profile. The rest of this resolution stands.

[Generated by AI]

Amended by #133 (resolution: https://git.babylondreams.de/AlexKucera/museion/issues/133#issuecomment-25197): skills are no longer same-payload ×3 — per-surface curation with one master copy symlinked per profile. The rest of this resolution stands. [Generated by AI]
Author
Owner

Amended by #132's resolution (defaults decided): fresh pass profiles no longer copy the museion profile's model block — the provisioner writes explicit per-surface defaults via hermes -p <profile> config set (claude-sonnet-5-5 / anthropic; a Swift constant, same home as #133's skills allocation map). Copying museion's block would seed glm-5.3-max, which the bench ruled against (8.5× wall, 11.9× tokens vs low, no quality gain). The config set write path itself stands as resolved here.

[Generated by AI]

Amended by #132's resolution (defaults decided): fresh pass profiles no longer copy the museion profile's model block — the provisioner writes **explicit per-surface defaults** via `hermes -p <profile> config set` (claude-sonnet-5-5 / anthropic; a Swift constant, same home as #133's skills allocation map). Copying museion's block would seed glm-5.3-max, which the bench ruled against (8.5× wall, 11.9× tokens vs low, no quality gain). The `config set` write path itself stands as resolved here. [Generated by AI]
Sign in to join this conversation.