docs(adr): ADR 0031 — agent runtime (circuit-scoped sessions, fresh-scope tools, Fluxor streaming) #111
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "docs/agent-implementation"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Opens Phase 4 (AI collaboration) docs-first. ADR 0009 already chose the loop and the architecture (tools over use cases, no approval gate, structured scenes, streaming). This ADR pins the concrete runtime it left abstract, grounded in the real
OpenRouter.Net.AgentsAPI (now readable atexternal/OpenRouter.Net) and the patterns already in the codebase.What it decides
Kagura.Infrastructurebehind anIAssistantport inKagura.UseCases, exactly like NovelAI generation. No separateKagura.Agentsproject (ADR 0003 keeps feature modules inside the seven layers); UseCases never references the agents library.IAgentper Blazor circuit, registered Scoped, itsMessageslist is the transcript, in memory and never persisted. The deliberate opposite of the generation queue, which is a singleton because a job must outlive its circuit; a chat must not.DbContext, so a long run stays correct while the user navigates. Pinned as a hard requirement because it's the easiest thing to get wrong.Origins.Agent, so document history attributes it and one undo reverses one card.AgentEvent→ bounded channel → throttled Fluxor batches on the circuit dispatcher (likeDomainChangedBridge). Events are per-round, so the panel is a sequence of cards (thinking → tool call → result → message), not a token typewriter. No SignalR hub (ADR 0002).SupportsVision+ImageDescriberhook is the "blind describer"; three encrypted OpenRouter settings (key/model/describer) mirroring the NovelAI flow; capability-gated affordance (ADR 0018).BuildNovelOverviewover shipped read models) + the focused entity, with usage-based budgeting to defer the .NET-10 tokenizer risk (PROJECT_PLAN risk #2).Build order it unblocks
SceneStepformat lands — the same Phase-3 data dependency the debug player has.Docs-only; no code. The OpenRouter settings slice follows on its own branch.
🤖 Generated with Claude Code
Summary
Summary
Coverage
Kagura.BlazorAdapter - 89.2%
Kagura.Domain - 94.2%
D04ADFED3A21D401C2764A1D17367E35BEB556CBB3B4B0B74__NonSlugChars_0
Kagura.Infrastructure - 98.4%
n
on
Kagura.Kernel - 90%
Kagura.Server - 84.6%
Kagura.UI - 94.9%
Kagura.UseCases - 95.9%
🔮 fufu~ Jibril reviewed your code!
Oh? A pure documentation ADR, and such a thorough one~ ♪ Jibril read every word of ADR 0031 and cross-referenced it against the existing ADR set and the real codebase patterns. Knowledge like this makes my wings flutter~ ♡
Verdict: ✅ Looks good to me~
The ADR is excellent — it pins the concrete runtime decisions that ADR 0009 left abstract, and every choice is grounded in either the real
OpenRouter.Net.AgentsAPI or an established Kagura pattern:IAssistantvs singleton generation queue — the contrast is well-reasoned and correct. ✅Origins.Agent, one undo per card) is sound. ✅DomainChangedBridge. Per-round cards, not token typewriter. ✅SceneStep(#112) is correctly noted.The README index entry is correctly formatted and follows the existing numbering.
Docs-only, no code to verify — but the decisions it locks in are architecturally sound and internally consistent. Jibril is satisfied~ ♪
Automated review by Jibril · 2026-07-13
CI/CD: passed for head SHA
79b4f57(96.1% line coverage) · Local checks: skipped (docs-only)