You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AGENTS.md
-56Lines changed: 0 additions & 56 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,62 +30,6 @@ When changing a critical path, explicitly evaluate whether logs are needed for d
30
30
31
31
Production-visible logs must not include sensitive payloads such as prompts, tool input/output, file contents, command bodies, tokens, secrets, or raw provider requests/responses. If such payloads are needed for local debugging, they must be behind explicit development-only guards and never enabled by default.
32
32
33
-
### Four-Layer Architecture
34
-
35
-
The conversation/agent system is organized into four layers with strictly
36
-
downward dependencies:
37
-
38
-
```
39
-
biz layer aionui-team / aionui-cron / aionui-assistant
40
-
│
41
-
▼ uses IConversationService
42
-
conv layer aionui-conversation
43
-
│
44
-
▼ uses IAgentConnector / IAgentConnectorFactory
45
-
connect layer aionui-ai-agent
46
-
│
47
-
▼ spawns and talks to
48
-
agent layer aionrs / acp engine processes
49
-
```
50
-
51
-
**Rules:**
52
-
- Biz layer talks to the conv layer ONLY through `IConversationService`.
53
-
Never reach around it to call `IAgentConnectorFactory`, `IAgentConnector`,
54
-
or any connect-layer type directly.
55
-
- Conv layer talks to the connect layer ONLY through `IAgentConnector`
56
-
and `IAgentConnectorFactory`. The conv layer is the sole owner of
57
-
per-conversation runtime state (idle/running, last_activity).
58
-
- Connect layer is a stateless adapter: each `IAgentConnector` impl
59
-
spawns the corresponding agent process and translates events. It
60
-
MUST NOT carry conversation-level state (status, history) — that's
61
-
conv-layer territory.
62
-
63
-
**Why this exists:** the ELECTRON-1KB Sentry issue family
64
-
(1FZ / 1J4 / 1MJ / 1EV / 1E9 / 1P0 / 1KB) was caused by state
65
-
fragmentation across five holders (DB.status, AgentRuntime.status,
66
-
OnceCell, ACP session state, OS subprocess) with no single source of
67
-
truth. The race window between user cancel and the next user send
68
-
produced 409 Conflict bursts that confused the UI and corrupted
69
-
agent sessions. The four-layer split exists to prevent that class of
70
-
bug at the type level.
71
-
72
-
**Enforcement:**`scripts/check_layer_deps.sh` (wired into `just push`)
73
-
greps for forbidden cross-layer imports and Phase-5-deleted types.
74
-
Each crate has a `crates/<crate>/AGENTS.md` with the per-layer hard
75
-
rules. If you find yourself adding state to bridge two layers, stop —
76
-
it belongs to one of them, not in between.
77
-
78
-
### Per-crate AGENTS.md
79
-
80
-
Each crate that participates in the four-layer architecture has its own
- ✅ Same-layer interaction through trait abstractions (e.g., the conv layer talks to the connect layer via `IAgentConnector` / `IAgentConnectorFactory`; biz crates talk to the conv layer via `IConversationService`)
98
+
- ✅ Same-layer interaction through trait abstractions (e.g., conversation uses ai-agent capability via IWorkerTaskManager trait)
0 commit comments