memorix 1.1.10 → 1.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +38 -0
- package/README.md +1 -1
- package/README.zh-CN.md +1 -1
- package/TEAM.md +86 -86
- package/dist/cli/index.js +2630 -886
- package/dist/cli/index.js.map +1 -1
- package/dist/dashboard/static/app.js +29 -3
- package/dist/dashboard/static/index.html +201 -201
- package/dist/dashboard/static/style.css +3762 -3584
- package/dist/index.js +2884 -1283
- package/dist/index.js.map +1 -1
- package/dist/maintenance-runner.d.ts +40 -0
- package/dist/maintenance-runner.js +8409 -0
- package/dist/maintenance-runner.js.map +1 -0
- package/dist/memcode-runtime/CHANGELOG.md +38 -0
- package/dist/memcode-runtime/package.json +4 -4
- package/dist/sdk.js +2881 -1280
- package/dist/sdk.js.map +1 -1
- package/docs/AGENT_OPERATOR_PLAYBOOK.md +1 -1
- package/docs/CONFIGURATION.md +15 -4
- package/docs/DESIGN_DECISIONS.md +357 -357
- package/docs/GIT_MEMORY.md +2 -2
- package/docs/INTEGRATIONS.md +1 -1
- package/docs/PERFORMANCE.md +23 -0
- package/docs/dev-log/progress.txt +62 -26
- package/docs/hooks-architecture.md +24 -12
- package/package.json +1 -1
- package/plugins/codex/memorix/.codex-plugin/plugin.json +1 -0
- package/plugins/codex/memorix/hooks/hooks.json +30 -0
- package/src/audit/index.ts +156 -156
- package/src/cli/commands/audit-list.ts +89 -89
- package/src/cli/commands/background.ts +659 -659
- package/src/cli/commands/cleanup.ts +279 -255
- package/src/cli/commands/codegraph.ts +7 -5
- package/src/cli/commands/formation.ts +48 -48
- package/src/cli/commands/git-hook-install.ts +111 -111
- package/src/cli/commands/handoff.ts +66 -66
- package/src/cli/commands/hooks-install.ts +2 -1
- package/src/cli/commands/hooks-status.ts +63 -63
- package/src/cli/commands/ingest-commit.ts +153 -153
- package/src/cli/commands/ingest-image.ts +73 -73
- package/src/cli/commands/ingest-log.ts +180 -180
- package/src/cli/commands/ingest.ts +44 -44
- package/src/cli/commands/integrate-shared.ts +15 -15
- package/src/cli/commands/lock.ts +96 -96
- package/src/cli/commands/message.ts +121 -121
- package/src/cli/commands/poll.ts +70 -70
- package/src/cli/commands/purge-all-memory.ts +85 -85
- package/src/cli/commands/purge-project-memory.ts +83 -83
- package/src/cli/commands/reasoning.ts +132 -132
- package/src/cli/commands/retention.ts +107 -108
- package/src/cli/commands/serve-http.ts +49 -22
- package/src/cli/commands/serve-shared.ts +118 -118
- package/src/cli/commands/setup.ts +7 -1
- package/src/cli/commands/skills.ts +123 -123
- package/src/cli/commands/task.ts +192 -192
- package/src/cli/commands/transfer.ts +73 -73
- package/src/cli/commands/uninstall-project-artifacts.ts +85 -85
- package/src/cli/tui/ChatView.tsx +234 -234
- package/src/cli/tui/CommandBar.tsx +312 -312
- package/src/cli/tui/ContextRail.tsx +118 -118
- package/src/cli/tui/HeaderBar.tsx +72 -72
- package/src/cli/tui/LogoBanner.tsx +51 -51
- package/src/cli/tui/Panels.tsx +632 -632
- package/src/cli/tui/Sidebar.tsx +179 -179
- package/src/cli/tui/chat-service.ts +736 -742
- package/src/cli/tui/data.ts +545 -547
- package/src/cli/tui/index.ts +41 -41
- package/src/cli/tui/markdown-render.tsx +371 -371
- package/src/cli/tui/theme.ts +178 -178
- package/src/cli/tui/use-mouse.ts +157 -157
- package/src/cli/tui/useNavigation.ts +56 -56
- package/src/cli/update-checker.ts +211 -211
- package/src/cli/version.ts +7 -7
- package/src/cli/workbench.ts +1 -1
- package/src/codegraph/auto-context.ts +49 -22
- package/src/codegraph/exclude.ts +10 -0
- package/src/codegraph/lite-provider.ts +146 -16
- package/src/codegraph/project-context.ts +23 -0
- package/src/codegraph/store.ts +123 -0
- package/src/compact/token-budget.ts +74 -74
- package/src/config/behavior.ts +97 -59
- package/src/config/resolved-config.ts +4 -0
- package/src/config/toml-loader.ts +2 -0
- package/src/config/yaml-loader.ts +3 -1
- package/src/dashboard/project-classification.ts +64 -64
- package/src/dashboard/server.ts +31 -30
- package/src/dashboard/static/index.html +201 -201
- package/src/dashboard/static/style.css +3762 -3584
- package/src/embedding/api-provider.ts +105 -6
- package/src/embedding/fastembed-provider.ts +142 -142
- package/src/embedding/provider.ts +31 -3
- package/src/embedding/transformers-provider.ts +111 -111
- package/src/git/extractor.ts +209 -209
- package/src/git/hooks-path.ts +85 -85
- package/src/git/noise-filter.ts +226 -210
- package/src/hooks/handler.ts +61 -16
- package/src/hooks/installers/index.ts +48 -7
- package/src/hooks/normalizer.ts +15 -0
- package/src/hooks/pattern-detector.ts +173 -173
- package/src/hooks/significance-filter.ts +250 -250
- package/src/llm/memory-manager.ts +328 -328
- package/src/llm/provider.ts +885 -885
- package/src/llm/quality.ts +248 -248
- package/src/memory/attribution-guard.ts +249 -249
- package/src/memory/auto-relations.ts +107 -107
- package/src/memory/consolidation.ts +328 -302
- package/src/memory/disclosure-policy.ts +141 -141
- package/src/memory/entity-extractor.ts +197 -197
- package/src/memory/export-import.ts +3 -1
- package/src/memory/formation/evaluate.ts +217 -217
- package/src/memory/formation/extract.ts +361 -361
- package/src/memory/formation/index.ts +417 -417
- package/src/memory/formation/resolve.ts +344 -344
- package/src/memory/formation/types.ts +315 -315
- package/src/memory/freshness.ts +122 -122
- package/src/memory/graph.ts +197 -197
- package/src/memory/observations.ts +181 -42
- package/src/memory/refs.ts +94 -94
- package/src/memory/retention.ts +511 -433
- package/src/memory/secret-filter.ts +79 -79
- package/src/memory/session.ts +542 -523
- package/src/multimodal/image-loader.ts +143 -143
- package/src/orchestrate/adapters/claude-stream.ts +192 -192
- package/src/orchestrate/adapters/claude.ts +111 -111
- package/src/orchestrate/adapters/codex-stream.ts +134 -134
- package/src/orchestrate/adapters/codex.ts +41 -41
- package/src/orchestrate/adapters/gemini-stream.ts +166 -166
- package/src/orchestrate/adapters/gemini.ts +42 -42
- package/src/orchestrate/adapters/index.ts +73 -73
- package/src/orchestrate/adapters/opencode-stream.ts +143 -143
- package/src/orchestrate/adapters/opencode.ts +47 -47
- package/src/orchestrate/adapters/spawn-helper.ts +286 -286
- package/src/orchestrate/adapters/types.ts +77 -77
- package/src/orchestrate/capability-router.ts +284 -284
- package/src/orchestrate/context-compact.ts +188 -188
- package/src/orchestrate/cost-tracker.ts +219 -219
- package/src/orchestrate/error-recovery.ts +191 -191
- package/src/orchestrate/evidence.ts +140 -140
- package/src/orchestrate/ledger.ts +110 -110
- package/src/orchestrate/memorix-bridge.ts +380 -380
- package/src/orchestrate/output-budget.ts +80 -80
- package/src/orchestrate/permission.ts +152 -152
- package/src/orchestrate/pipeline-trace.ts +131 -131
- package/src/orchestrate/prompt-builder.ts +155 -155
- package/src/orchestrate/ring-buffer.ts +37 -37
- package/src/orchestrate/task-graph.ts +389 -389
- package/src/orchestrate/verify-gate.ts +219 -219
- package/src/orchestrate/worktree.ts +232 -232
- package/src/project/aliases.ts +374 -374
- package/src/project/detector.ts +268 -268
- package/src/rules/adapters/claude-code.ts +99 -99
- package/src/rules/adapters/codex.ts +97 -97
- package/src/rules/adapters/copilot.ts +124 -124
- package/src/rules/adapters/cursor.ts +114 -114
- package/src/rules/adapters/kiro.ts +126 -126
- package/src/rules/adapters/trae.ts +56 -56
- package/src/rules/adapters/windsurf.ts +83 -83
- package/src/rules/syncer.ts +235 -235
- package/src/runtime/control-plane-maintenance.ts +62 -0
- package/src/runtime/isolated-maintenance.ts +187 -0
- package/src/runtime/maintenance-jobs.ts +512 -0
- package/src/runtime/maintenance-runner.ts +96 -0
- package/src/runtime/maintenance-targets.ts +59 -0
- package/src/runtime/project-maintenance.ts +274 -0
- package/src/sdk.ts +327 -327
- package/src/search/intent-detector.ts +289 -289
- package/src/search/query-expansion.ts +52 -52
- package/src/server/formation-timeout.ts +27 -27
- package/src/server.ts +212 -224
- package/src/skills/mini-skills.ts +386 -386
- package/src/store/chat-store.ts +119 -119
- package/src/store/file-lock.ts +100 -100
- package/src/store/graph-store.ts +249 -249
- package/src/store/mini-skill-store.ts +349 -349
- package/src/store/obs-store.ts +293 -255
- package/src/store/orama-store.ts +169 -17
- package/src/store/persistence-json.ts +212 -212
- package/src/store/persistence.ts +291 -291
- package/src/store/project-affinity.ts +195 -195
- package/src/store/session-store.ts +268 -259
- package/src/store/sqlite-db.ts +40 -0
- package/src/store/sqlite-store.ts +429 -339
- package/src/team/event-bus.ts +76 -76
- package/src/team/file-locks.ts +173 -173
- package/src/team/handoff.ts +167 -167
- package/src/team/messages.ts +203 -203
- package/src/team/poll.ts +132 -132
- package/src/team/tasks.ts +211 -211
- package/src/wiki/generator.ts +237 -237
- package/src/wiki/knowledge-graph.ts +334 -334
- package/src/wiki/types.ts +85 -85
- package/src/workspace/mcp-adapters/codex.ts +191 -191
- package/src/workspace/mcp-adapters/copilot.ts +105 -105
- package/src/workspace/mcp-adapters/cursor.ts +53 -53
- package/src/workspace/mcp-adapters/kiro.ts +64 -64
- package/src/workspace/mcp-adapters/opencode.ts +123 -123
- package/src/workspace/mcp-adapters/trae.ts +134 -134
- package/src/workspace/mcp-adapters/windsurf.ts +91 -91
- package/src/workspace/sanitizer.ts +60 -60
- package/src/workspace/workflow-sync.ts +131 -131
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,44 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [Unreleased]
|
|
6
|
+
|
|
7
|
+
## [1.1.12] - 2026-07-17
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
- **Codex lifecycle hook capture** -- The Memorix Codex plugin now bundles the documented `SessionStart`, `UserPromptSubmit`, `PostToolUse`, `PreCompact`, and `Stop` hook events, with a Windows-safe `commandWindows` command override.
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
- **Codex hook normalization and injection** -- Codex lifecycle payloads now preserve their event names, `SessionStart` returns Codex-native `hookSpecificOutput.additionalContext`, and capture-only events stay quiet instead of filling the agent context with save-status messages.
|
|
14
|
+
- **OpenCode hooks on Windows** -- The generated plugin resolves the installed npm `memorix.cmd` shim while setup runs and uses that stable path inside OpenCode, instead of relying on OpenCode's inherited `PATH`. Hook delivery stays quiet unless `MEMORIX_HOOK_DEBUG=1` is explicitly set. Fixes #125.
|
|
15
|
+
- **Setup scope isolation** -- Project-level setup no longer installs Claude, Codex, or Copilot plugin bundles in the user home. Use `--global` for user-level plugins, skills, and lifecycle hooks.
|
|
16
|
+
- **TUI embedding startup** -- TUI health, chat, and quick-search paths now use the same lexical-ready startup flow as MCP instead of making a remote dimension probe during the first screen or search.
|
|
17
|
+
- **Semantic recall after restart** -- API-backed embeddings now restore compatible vectors from the local cache during index hydration, without placing remote embedding calls on the MCP startup path. Redundant namespace-scoped cache metadata survives a lost dimensions cache; cache misses enter the existing bounded background recovery lane, and the first successful vector upgrades a cache-less lexical index in the same process. Based on the diagnosis in #126 by @Tom-Ma-Ming.
|
|
18
|
+
- **Concurrent index startup** -- Cache-only startup and ordinary database callers now share one Orama initialization, so a later vector-schema attempt cannot replace an already hydrated lexical index. Resets also discard obsolete in-flight instances.
|
|
19
|
+
- **Lazy API vector-cache I/O** -- A cache-only start with no trusted dimension metadata now skips parsing the potentially large API vector cache entirely; the cache is loaded only after compatible local metadata or a normal embedding initialization establishes its dimensions.
|
|
20
|
+
|
|
21
|
+
## [1.1.11] - 2026-07-16
|
|
22
|
+
|
|
23
|
+
### Added
|
|
24
|
+
- **Durable runtime maintenance** -- Added a SQLite-backed maintenance ledger for vector recovery, retention, consolidation, and Code Memory refresh. Jobs use dedupe keys, leases, heartbeats, retry backoff, resumable cursors, and operator-visible state.
|
|
25
|
+
- **Isolated maintenance runner** -- Retention, consolidation, and Code Memory scans now run through a compiled child-process runner instead of sharing an MCP request/event loop. Vector recovery stays with the owning process because its Orama index is process-local.
|
|
26
|
+
- **Code Memory scan safeguards** -- CodeGraph Lite now skips common dependency/build directories and source files larger than 2 MiB by default. Configure the limit with `[codegraph].max_file_bytes` or YAML `codegraph.maxFileBytes`.
|
|
27
|
+
- **Maintenance diagnostics** -- Dashboard APIs and System Status now show queued/running/failed maintenance state without mixing projects.
|
|
28
|
+
|
|
29
|
+
### Changed
|
|
30
|
+
- **First-turn MCP readiness** -- `memorix_project_context`, `memorix_context_pack`, `memorix_graph_context`, and `memorix_codegraph_status` now read the current project's SQLite state directly before full Orama hydration. Search, writes, and sessions retain their full-runtime boundary.
|
|
31
|
+
- **Bounded memory lifecycle** -- Automatic retention and consolidation process one project page at a time and resume through durable cursors, avoiding corpus-sized work in an interactive request.
|
|
32
|
+
- **Incremental Code Memory** -- Changed files are reparsed, unchanged files keep their metadata, and removed/oversized files are removed from the graph without replacing the entire project graph.
|
|
33
|
+
- **Mobile dashboard navigation** -- The desktop sidebar becomes a compact mobile navigation layout so dashboard content remains readable on narrow screens.
|
|
34
|
+
|
|
35
|
+
### Fixed
|
|
36
|
+
- **Cross-process refresh model** -- Removed the obsolete JSON-file polling watcher. SQLite generation checks are now the sole authoritative mechanism for cross-process observation freshness.
|
|
37
|
+
- **Maintenance history and diagnostics** -- Completed maintenance records expire after a retention window; persisted failure messages redact credential values.
|
|
38
|
+
- **Maintenance enqueue atomicity** -- History pruning now runs inside the enqueue transaction, so a failed enqueue cannot discard completed diagnostic history.
|
|
39
|
+
- **Dashboard project scope** -- Knowledge, graph, retention, observation, and export reads use project-scoped SQLite queries instead of loading and filtering the full flat memory store.
|
|
40
|
+
- **Behavior configuration alignment** -- TOML/YAML memory behavior settings now drive runtime injection, formation, auto-cleanup, and sync advisory behavior; legacy `config.json` is a fallback rather than a separate source of truth.
|
|
41
|
+
- **Container runtime privilege** -- The official HTTP control-plane image is explicitly verified to run as the non-root `node` user.
|
|
42
|
+
|
|
5
43
|
## [1.1.10] - 2026-07-13
|
|
6
44
|
|
|
7
45
|
### Fixed
|
package/README.md
CHANGED
|
@@ -245,7 +245,7 @@ memorix setup --agent omp --global
|
|
|
245
245
|
What it installs depends on the target agent, but the goal is the same: make Memorix available wherever you open that agent without asking you to wire every repo by hand.
|
|
246
246
|
|
|
247
247
|
- Claude Code: installs the Memorix plugin package, adds `CLAUDE.md` guidance, and enables hook capture when you do not pass `--noHooks`.
|
|
248
|
-
- Codex: installs the Memorix plugin package, adds `AGENTS.md` guidance,
|
|
248
|
+
- Codex: installs the Memorix plugin package with stdio MCP, skills, and lifecycle hooks, then adds `AGENTS.md` guidance. When Codex asks, review the plugin hook definition once with `/hooks`; `--noHooks` skips automatic capture.
|
|
249
249
|
- GitHub Copilot CLI: installs the Copilot plugin package and official Memorix skills.
|
|
250
250
|
- Pi: installs the user-level Pi package and official skills.
|
|
251
251
|
- Cursor: writes Cursor MCP/rules/config entries in the chosen scope.
|
package/README.zh-CN.md
CHANGED
|
@@ -245,7 +245,7 @@ memorix setup --agent omp --global
|
|
|
245
245
|
它会做的事情取决于目标 Agent,但目标是一致的:你以后在哪里打开这个 Agent,Memorix 就可以在哪里被使用,而不是让你一个仓库一个仓库重复配置。
|
|
246
246
|
|
|
247
247
|
- Claude Code:安装 Memorix 插件包,写入 `CLAUDE.md` 使用规范;不加 `--noHooks` 时会启用自动捕获。
|
|
248
|
-
- Codex
|
|
248
|
+
- Codex:安装包含 stdio MCP、skills 和生命周期 hooks 的 Memorix 插件包,并写入 `AGENTS.md` 使用规范。Codex 首次要求时,在 `/hooks` 中审核一次插件 hook;使用 `--noHooks` 可跳过自动捕获。
|
|
249
249
|
- GitHub Copilot CLI:安装 Copilot 插件包和官方 Memorix skills。
|
|
250
250
|
- Pi:安装用户级 Pi package 和官方 skills。
|
|
251
251
|
- Cursor:写入 Cursor 的 MCP / rules / 配置。
|
package/TEAM.md
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
# Memorix Team Protocol
|
|
2
|
-
|
|
1
|
+
# Memorix Team Protocol
|
|
2
|
+
|
|
3
3
|
Rules for project-scoped autonomous-agent coordination via Memorix team tools. The Team page is an **Agent Team status surface** — it shows explicitly joined autonomous agents, open tasks, locks, messages, handoffs, and what needs attention. It is NOT an organization backend, staffing admin tool, or automatic chat room between separate IDE windows.
|
|
4
4
|
|
|
5
5
|
Only agents that are intentionally participating in team/task/message/lock workflows need this protocol. Memory-only sessions should stay lightweight and do not need a team identity.
|
|
6
6
|
|
|
7
7
|
For real autonomous multi-agent development, prefer `memorix orchestrate`: it launches and supervises CLI agent workers through Memorix tasks, context, verification, and fix loops. The team tools support that workflow; they should not be interpreted as proof that unrelated IDE conversation windows can autonomously contact each other.
|
|
8
|
-
|
|
9
|
-
There are 4 team tools, each with an `action` parameter:
|
|
10
|
-
|
|
11
|
-
- `team_manage` — action: join / leave / status
|
|
12
|
-
- `team_file_lock` — action: lock / unlock / status
|
|
13
|
-
- `team_task` — action: create / claim / complete / list
|
|
14
|
-
- `team_message` — action: send / broadcast / inbox
|
|
15
|
-
|
|
8
|
+
|
|
9
|
+
There are 4 team tools, each with an `action` parameter:
|
|
10
|
+
|
|
11
|
+
- `team_manage` — action: join / leave / status
|
|
12
|
+
- `team_file_lock` — action: lock / unlock / status
|
|
13
|
+
- `team_task` — action: create / claim / complete / list
|
|
14
|
+
- `team_message` — action: send / broadcast / inbox
|
|
15
|
+
|
|
16
16
|
## RULE 1: Start Lightweight, Join Team Explicitly
|
|
17
17
|
|
|
18
18
|
At the **beginning of every memory session**, before project-scoped memory work:
|
|
@@ -25,82 +25,82 @@ At the **beginning of every memory session**, before project-scoped memory work:
|
|
|
25
25
|
4. Store the returned **agent ID** only after an explicit join — you will need it for subsequent team operations.
|
|
26
26
|
5. Call `memorix_poll` with your agent ID to see current autonomous agents, check available tasks, and read unread messages.
|
|
27
27
|
6. If you need a custom role or capabilities, use explicit `team_manage(join)` so the role overrides the default mapping cleanly.
|
|
28
|
-
|
|
29
|
-
## RULE 2: Lock Before Edit
|
|
30
|
-
|
|
31
|
-
Before modifying any file that another agent might also be working on:
|
|
32
|
-
|
|
33
|
-
1. Call `team_file_lock` with `action: "status"` and the file path to check if it is already locked.
|
|
34
|
-
2. If unlocked, call `team_file_lock` with `action: "lock"`, the file path, and your agent ID.
|
|
35
|
-
3. If locked by another agent, **do not edit that file**. Either:
|
|
36
|
-
- Work on a different file.
|
|
37
|
-
- Send a `request` message to the lock owner asking them to release it.
|
|
38
|
-
- Wait and re-check later.
|
|
39
|
-
4. When you are done editing, call `team_file_lock` with `action: "unlock"` to release the lock.
|
|
40
|
-
|
|
41
|
-
**Never edit a file locked by another agent.** Lock violations cause merge conflicts and data loss.
|
|
42
|
-
|
|
43
|
-
Locks auto-expire after 10 minutes. If you hold a lock for extended work, re-lock periodically to refresh the TTL.
|
|
44
|
-
|
|
45
|
-
## RULE 3: Use Tasks for Work Coordination
|
|
46
|
-
|
|
47
|
-
When the user assigns work that involves multiple agents or multiple steps:
|
|
48
|
-
|
|
49
|
-
1. Call `team_task` with `action: "create"` to break the work into discrete tasks with clear descriptions.
|
|
50
|
-
2. Use `deps` to declare dependencies between tasks (a task cannot be claimed until its dependencies are completed).
|
|
51
|
-
3. Call `team_task` with `action: "claim"` to assign a task to yourself before starting work on it.
|
|
52
|
-
4. Call `team_task` with `action: "complete"` and a `result` summary when the task is done.
|
|
53
|
-
5. Call `team_task` with `action: "list"` to see overall progress and find available work.
|
|
54
|
-
|
|
55
|
-
Rules:
|
|
56
|
-
- Only claim tasks whose dependencies are all completed.
|
|
57
|
-
- Only one agent may claim a given task.
|
|
58
|
-
- If you cannot complete a claimed task, leave the team so the task returns to pending and another agent can pick it up.
|
|
59
|
-
|
|
60
|
-
## RULE 4: Communication Protocol
|
|
61
|
-
|
|
62
|
-
Use `team_message` with `action: "send"` for direct messages and `action: "broadcast"` for announcements. Message types and their intended use:
|
|
63
|
-
|
|
64
|
-
| Type | Use |
|
|
65
|
-
|------|-----|
|
|
66
|
-
| `request` | Ask another agent to do something, release a lock, or provide information. |
|
|
67
|
-
| `response` | Reply to a prior request. |
|
|
68
|
-
| `info` | Share context: discoveries, status updates, warnings about tricky code. |
|
|
69
|
-
| `announcement` | Broadcast to all agents: major state changes, deployment events, breaking changes. |
|
|
70
|
-
| `contract` | Propose or agree on a division of work. Both agents should acknowledge. |
|
|
71
|
-
| `error` | Report a blocking issue that requires another agent's attention. |
|
|
72
|
-
|
|
73
|
-
Rules:
|
|
74
|
-
- `action: "send"` requires the full UUID of the target agent. Get it from `team_manage` with `action: "status"`.
|
|
75
|
-
- Check your inbox (`action: "inbox"`) at least once before starting new work and once before ending a session.
|
|
76
|
-
- Keep message content under 10KB. Be concise and actionable.
|
|
77
|
-
|
|
78
|
-
## RULE 5: Leave on Session End
|
|
79
|
-
|
|
80
|
-
When the session is ending:
|
|
81
|
-
|
|
82
|
-
1. Call `team_file_lock` with `action: "unlock"` for every file you have locked, or they will remain locked until TTL expiry (10 min).
|
|
83
|
-
2. If you have in-progress tasks you cannot finish, leave them — leaving releases your tasks back to pending.
|
|
84
|
-
3. Call `team_manage` with `action: "leave"` and your agent ID. This marks you inactive, releases all your locks, and clears your inbox.
|
|
85
|
-
|
|
86
|
-
## RULE 6: Conflict Prevention
|
|
87
|
-
|
|
88
|
-
- **Check before acting.** Always check team status and file lock status before starting work to understand the current state.
|
|
89
|
-
- **Communicate before diverging.** If you plan to refactor shared code, broadcast an `announcement` first so other agents can save their work.
|
|
90
|
-
- **Respect lock ownership.** The lock holder has exclusive write access. No exceptions.
|
|
91
|
-
- **Prefer small, scoped changes.** Large cross-cutting changes increase conflict risk. Coordinate via tasks and messages if a change touches files other agents are working on.
|
|
92
|
-
- **Do not duplicate work.** Check the task list before creating new tasks. If a similar task exists, claim it instead of creating a duplicate.
|
|
93
|
-
|
|
94
|
-
## Summary of Required Calls
|
|
95
|
-
|
|
96
|
-
| When | Tool Call |
|
|
97
|
-
|------|-----------|
|
|
28
|
+
|
|
29
|
+
## RULE 2: Lock Before Edit
|
|
30
|
+
|
|
31
|
+
Before modifying any file that another agent might also be working on:
|
|
32
|
+
|
|
33
|
+
1. Call `team_file_lock` with `action: "status"` and the file path to check if it is already locked.
|
|
34
|
+
2. If unlocked, call `team_file_lock` with `action: "lock"`, the file path, and your agent ID.
|
|
35
|
+
3. If locked by another agent, **do not edit that file**. Either:
|
|
36
|
+
- Work on a different file.
|
|
37
|
+
- Send a `request` message to the lock owner asking them to release it.
|
|
38
|
+
- Wait and re-check later.
|
|
39
|
+
4. When you are done editing, call `team_file_lock` with `action: "unlock"` to release the lock.
|
|
40
|
+
|
|
41
|
+
**Never edit a file locked by another agent.** Lock violations cause merge conflicts and data loss.
|
|
42
|
+
|
|
43
|
+
Locks auto-expire after 10 minutes. If you hold a lock for extended work, re-lock periodically to refresh the TTL.
|
|
44
|
+
|
|
45
|
+
## RULE 3: Use Tasks for Work Coordination
|
|
46
|
+
|
|
47
|
+
When the user assigns work that involves multiple agents or multiple steps:
|
|
48
|
+
|
|
49
|
+
1. Call `team_task` with `action: "create"` to break the work into discrete tasks with clear descriptions.
|
|
50
|
+
2. Use `deps` to declare dependencies between tasks (a task cannot be claimed until its dependencies are completed).
|
|
51
|
+
3. Call `team_task` with `action: "claim"` to assign a task to yourself before starting work on it.
|
|
52
|
+
4. Call `team_task` with `action: "complete"` and a `result` summary when the task is done.
|
|
53
|
+
5. Call `team_task` with `action: "list"` to see overall progress and find available work.
|
|
54
|
+
|
|
55
|
+
Rules:
|
|
56
|
+
- Only claim tasks whose dependencies are all completed.
|
|
57
|
+
- Only one agent may claim a given task.
|
|
58
|
+
- If you cannot complete a claimed task, leave the team so the task returns to pending and another agent can pick it up.
|
|
59
|
+
|
|
60
|
+
## RULE 4: Communication Protocol
|
|
61
|
+
|
|
62
|
+
Use `team_message` with `action: "send"` for direct messages and `action: "broadcast"` for announcements. Message types and their intended use:
|
|
63
|
+
|
|
64
|
+
| Type | Use |
|
|
65
|
+
|------|-----|
|
|
66
|
+
| `request` | Ask another agent to do something, release a lock, or provide information. |
|
|
67
|
+
| `response` | Reply to a prior request. |
|
|
68
|
+
| `info` | Share context: discoveries, status updates, warnings about tricky code. |
|
|
69
|
+
| `announcement` | Broadcast to all agents: major state changes, deployment events, breaking changes. |
|
|
70
|
+
| `contract` | Propose or agree on a division of work. Both agents should acknowledge. |
|
|
71
|
+
| `error` | Report a blocking issue that requires another agent's attention. |
|
|
72
|
+
|
|
73
|
+
Rules:
|
|
74
|
+
- `action: "send"` requires the full UUID of the target agent. Get it from `team_manage` with `action: "status"`.
|
|
75
|
+
- Check your inbox (`action: "inbox"`) at least once before starting new work and once before ending a session.
|
|
76
|
+
- Keep message content under 10KB. Be concise and actionable.
|
|
77
|
+
|
|
78
|
+
## RULE 5: Leave on Session End
|
|
79
|
+
|
|
80
|
+
When the session is ending:
|
|
81
|
+
|
|
82
|
+
1. Call `team_file_lock` with `action: "unlock"` for every file you have locked, or they will remain locked until TTL expiry (10 min).
|
|
83
|
+
2. If you have in-progress tasks you cannot finish, leave them — leaving releases your tasks back to pending.
|
|
84
|
+
3. Call `team_manage` with `action: "leave"` and your agent ID. This marks you inactive, releases all your locks, and clears your inbox.
|
|
85
|
+
|
|
86
|
+
## RULE 6: Conflict Prevention
|
|
87
|
+
|
|
88
|
+
- **Check before acting.** Always check team status and file lock status before starting work to understand the current state.
|
|
89
|
+
- **Communicate before diverging.** If you plan to refactor shared code, broadcast an `announcement` first so other agents can save their work.
|
|
90
|
+
- **Respect lock ownership.** The lock holder has exclusive write access. No exceptions.
|
|
91
|
+
- **Prefer small, scoped changes.** Large cross-cutting changes increase conflict risk. Coordinate via tasks and messages if a change touches files other agents are working on.
|
|
92
|
+
- **Do not duplicate work.** Check the task list before creating new tasks. If a similar task exists, claim it instead of creating a duplicate.
|
|
93
|
+
|
|
94
|
+
## Summary of Required Calls
|
|
95
|
+
|
|
96
|
+
| When | Tool Call |
|
|
97
|
+
|------|-----------|
|
|
98
98
|
| Session start | `memorix_session_start` (lightweight) |
|
|
99
99
|
| Join Agent Team | `memorix_session_start(joinTeam=true)` or `team_manage(join)` |
|
|
100
100
|
| After joining | `memorix_poll` (check status + inbox) |
|
|
101
|
-
| Before editing a shared file | `team_file_lock(status)`, `team_file_lock(lock)` |
|
|
102
|
-
| After editing | `team_file_lock(unlock)` |
|
|
103
|
-
| Starting a unit of work | `team_task(claim)` or `team_task(create)` + `team_task(claim)` |
|
|
104
|
-
| Finishing a unit of work | `team_task(complete)` |
|
|
105
|
-
| Need to coordinate | `team_message(send)` or `team_message(broadcast)` |
|
|
106
|
-
| Session end | `team_file_lock(unlock)` (all), `team_manage(leave)` |
|
|
101
|
+
| Before editing a shared file | `team_file_lock(status)`, `team_file_lock(lock)` |
|
|
102
|
+
| After editing | `team_file_lock(unlock)` |
|
|
103
|
+
| Starting a unit of work | `team_task(claim)` or `team_task(create)` + `team_task(claim)` |
|
|
104
|
+
| Finishing a unit of work | `team_task(complete)` |
|
|
105
|
+
| Need to coordinate | `team_message(send)` or `team_message(broadcast)` |
|
|
106
|
+
| Session end | `team_file_lock(unlock)` (all), `team_manage(leave)` |
|