Skip to content

Commit 34e0bcf

Browse files
authored
Documentation detail pass (#43)
* Rethought Arch structure and added some project specific docs. * Completed docs * Updated index
1 parent 8d3b9f2 commit 34e0bcf

File tree

29 files changed

+976
-229
lines changed

29 files changed

+976
-229
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ Use SemaphoreSlim over lock in async contexts.
8383
Use System.Threading.Lock for the lock.
8484

8585
## Misc
86+
All non‑standard library dependencies must be isolated to integrations. Only integrations may depend on integrations.
87+
8688
One class per file unless describing "dumb" data types like records.
8789

8890
We have enabled implicit usings globally.

INDEX.md

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,37 @@
1-
# Code
1+
# Index
22

33
Project overview: see [README](/README.md).
44

5-
## Coven Engine (Coven.Core)
6-
- [Coven.Core](/src/Coven.Core/)
7-
- [Coven.Core.Tests](/src/Coven.Core.Tests/)
5+
## Documentation
6+
- Root: [README](/README.md), [CONTRIBUTING](/CONTRIBUTING.md), [AGENTS](/AGENTS.md)
7+
- Licensing: [COMMERCIAL-TERMS](/COMMERCIAL-TERMS.md), [LICENSE](/LICENSE), [NOTICE](/NOTICE)
8+
- Architecture: [README](/architecture/README.md), [Journaling and Scriveners](/architecture/Journaling-and-Scriveners.md), [Abstractions and Branches](/architecture/Abstractions-and-Branches.md), [Windowing and Shattering](/architecture/Windowing-and-Shattering.md), [Licensing](/architecture/Licensing.md)
9+
- Build/Release: [Release Process](/build/ReleaseProcess.md), [VERSION](/build/VERSION)
810

9-
## Coven with Agents (Coven.Spellcasting)
10-
- [Coven.Spellcasting](/src/Coven.Spellcasting/)
11+
## Projects (src)
12+
- Solution: [/src/Coven.sln](/src/Coven.sln)
1113

12-
## Coven Infrastructure for Chat
13-
- [Coven.Chat](/src/Coven.Chat/)
14+
- Core: [/src/Coven.Core](/src/Coven.Core/) ([README](/src/Coven.Core/README.md))
15+
- Streaming: [/src/Coven.Core.Streaming](/src/Coven.Core.Streaming/) ([README](/src/Coven.Core.Streaming/README.md))
16+
- Daemonology: [/src/Coven.Daemonology](/src/Coven.Daemonology/) ([README](/src/Coven.Daemonology/README.md))
17+
- Transmutation: [/src/Coven.Transmutation](/src/Coven.Transmutation/) ([README](/src/Coven.Transmutation/README.md))
18+
- Spellcasting: [/src/Coven.Spellcasting](/src/Coven.Spellcasting/) ([README](/src/Coven.Spellcasting/README.md))
1419

15-
# Architecture Guide
20+
- Chat (branch): [/src/Coven.Chat](/src/Coven.Chat/) ([README](/src/Coven.Chat/README.md))
21+
- Chat Console (leaf): [/src/Coven.Chat.Console](/src/Coven.Chat.Console/) ([README](/src/Coven.Chat.Console/README.md))
22+
- Chat Discord (leaf): [/src/Coven.Chat.Discord](/src/Coven.Chat.Discord/) ([README](/src/Coven.Chat.Discord/README.md))
1623

17-
Explore by topic. All paths below are under `/architecture`.
24+
- Agents (branch): [/src/Coven.Agents](/src/Coven.Agents/) ([README](/src/Coven.Agents/README.md))
25+
- Agents OpenAI (leaf): [/src/Coven.Agents.OpenAI](/src/Coven.Agents.OpenAI/) ([README](/src/Coven.Agents.OpenAI/README.md))
1826

19-
- [Architecture README](/architecture/README.md)
27+
- Tests: [/src/Coven.Core.Tests](/src/Coven.Core.Tests/), [/src/Coven.Daemonology.Tests](/src/Coven.Daemonology.Tests/)
2028

21-
## Core Components
22-
- [Coven.Core](/architecture/Coven.Core.md)
23-
- [Coven.Chat](/architecture/Coven.Chat.md)
24-
- [Coven.Daemonology](/architecture/Coven.Daemonology.md)
25-
- [Coven.Spellcasting](/architecture/Coven.Spellcasting.md)
29+
## Samples
30+
- 01.DiscordAgent: [/src/samples/01.DiscordAgent](/src/samples/01.DiscordAgent/) ([README](/src/samples/01.DiscordAgent/README.md))
2631

27-
## Integrations
28-
- [Coven.Chat.Console](/architecture/Coven.Chat.Console.md)
29-
- [Coven.Chat.Discord](/architecture/Coven.Chat.Discord.md)
30-
- [Coven.Codex](/architecture/Coven.Codex.md)
31-
- [Coven.OpenAI](/architecture/Coven.OpenAI.md)
32-
- [Coven.Spellcasting.MCP](/architecture/Coven.Spellcasting.MCP.md)
33-
34-
## Meta
35-
- [Licensing](/architecture/Licensing.md)
32+
## Toys
33+
- [/src/toys/Coven.Toys.ConsoleChat](/src/toys/Coven.Toys.ConsoleChat/)
34+
- [/src/toys/Coven.Toys.ConsoleOpenAI](/src/toys/Coven.Toys.ConsoleOpenAI/)
35+
- [/src/toys/Coven.Toys.ConsoleOpenAIStreaming](/src/toys/Coven.Toys.ConsoleOpenAIStreaming/)
36+
- [/src/toys/Coven.Toys.DiscordChat](/src/toys/Coven.Toys.DiscordChat/)
37+
- [/src/toys/Coven.Toys.DiscordStreaming](/src/toys/Coven.Toys.DiscordStreaming/)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ await foreach ((long _, AgentEntry? entry) in _agents.TailAsync(0, cancellationT
127127

128128
### Extensibility
129129

130-
Window policies: tune output chunking/summarization. Example (from Sample 01 `Program.cs`):
130+
Semantic windowing: policies define when streamed messages are ready for decision‑making (not fixed turns). See: `architecture/Windowing-and-Shattering.md`.
131131

132132
```csharp
133133
// Paragraph-first + tighter max-length for agent outputs
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Abstractions and Branches:
2+
3+
Single takeaway: Integrate with Chat and Agents; swap leaves (Discord, Console, OpenAI) without changing your application logic.
4+
5+
## Spine, Branches, Leaves
6+
- Spine: your ritual pipeline (MagikBlocks) orchestrating work.
7+
- Branches: Chat and Agents abstractions that expose typed journals and services.
8+
- Leaves: integrations translating abstractions to external systems (e.g., Discord, OpenAI).
9+
10+
Your block logic writes/reads journal entries from Chat/Agents. The specific leaf is free to change (or multiply) behind the branch boundary.
11+
12+
## Directionality
13+
- Spine: your block/user code lives here.
14+
- Efferent: spine → leaves (outbound from your code to adapters).
15+
- Afferent: leaves → spine (inbound to your code from adapters).
16+
17+
## Chat
18+
- Contract: `IScrivener<ChatEntry>` representing inbound (afferent) and outbound (efferent) chat entries.
19+
- Examples: Discord and Console leaves both implement chat daemons and journals.
20+
- Windowing: chat drafts/outputs can be controlled via windowing policies.
21+
22+
## Agents
23+
- Contract: `IScrivener<AgentEntry>` representing prompts, thoughts, responses, and streaming chunks.
24+
- Streaming: leaves can stream agent outputs incrementally; window policies decide emission.
25+
- Templating: use `ITransmuter` to shape request/response items (context, persona, metadata).
26+
27+
## Swap Without Rewrites
28+
- Replace Discord with Console by changing DI registration; keep Chat code unchanged.
29+
- Switch AI providers or models by updating the Agents leaf; keep Agent journaling unchanged.
30+
- Combine multiple leaves (e.g., Discord + Console) and route via the same branch journals.
31+
32+
## DI Patterns
33+
- Register branches in DI via extension methods; prefer `TryAdd` within libraries.
34+
- Start leaf daemons in a block and optionally wait for `Status.Running`.
35+
- Keep application code unaware of leaf‑specific SDKs.
36+
37+
## Related
38+
- Journaling/Scriveners for boundary decoupling.
39+
- Windowing/Shattering for streaming behavior.

architecture/Coven.Chat.Console.md

Lines changed: 0 additions & 62 deletions
This file was deleted.

architecture/Coven.Chat.Discord.md

Whitespace-only changes.

architecture/Coven.Chat.md

Lines changed: 0 additions & 67 deletions
This file was deleted.

architecture/Coven.Codex.md

Whitespace-only changes.

architecture/Coven.Core.md

Whitespace-only changes.

architecture/Coven.Daemonology.md

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)