memorix 1.2.2 → 1.2.4
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 +27 -0
- package/README.md +3 -3
- package/README.zh-CN.md +3 -3
- package/TEAM.md +86 -86
- package/dist/cli/index.js +5199 -4726
- package/dist/cli/index.js.map +1 -1
- package/dist/index.js +428 -49
- package/dist/index.js.map +1 -1
- package/dist/maintenance-runner.js +97 -18
- package/dist/maintenance-runner.js.map +1 -1
- package/dist/memcode-runtime/CHANGELOG.md +27 -0
- package/dist/sdk.js +428 -49
- package/dist/sdk.js.map +1 -1
- package/docs/1.2.4-PERSISTENT-MEMORY-DELIVERY.md +86 -0
- package/docs/AGENT_OPERATOR_PLAYBOOK.md +13 -1
- package/docs/API_REFERENCE.md +13 -3
- package/docs/DESIGN_DECISIONS.md +357 -357
- package/docs/dev-log/progress.txt +60 -9
- package/package.json +1 -1
- package/plugins/codex/memorix/.codex-plugin/plugin.json +1 -1
- package/src/audit/index.ts +156 -156
- package/src/cli/capability-map.ts +1 -1
- package/src/cli/command-guide.ts +4 -1
- package/src/cli/commands/agent-integrations.ts +5 -1
- package/src/cli/commands/audit-list.ts +89 -89
- package/src/cli/commands/background.ts +659 -659
- package/src/cli/commands/codegraph.ts +1 -1
- package/src/cli/commands/context.ts +9 -1
- package/src/cli/commands/formation.ts +48 -48
- package/src/cli/commands/git-hook-install.ts +111 -111
- package/src/cli/commands/handoff.ts +54 -54
- 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 +66 -66
- 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 +82 -82
- package/src/cli/commands/message.ts +104 -104
- package/src/cli/commands/poll.ts +58 -58
- 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 +118 -118
- package/src/cli/commands/resume.ts +31 -0
- package/src/cli/commands/serve-shared.ts +118 -118
- package/src/cli/commands/session.ts +15 -7
- package/src/cli/commands/skills.ts +114 -114
- package/src/cli/commands/task.ts +167 -167
- package/src/cli/commands/transfer.ts +47 -47
- package/src/cli/commands/uninstall-project-artifacts.ts +85 -85
- package/src/cli/index.ts +3 -1
- 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/Sidebar.tsx +179 -179
- package/src/cli/tui/index.ts +41 -41
- package/src/cli/tui/markdown-render.tsx +371 -371
- package/src/cli/tui/session-service.ts +3 -2
- 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 +54 -1
- package/src/codegraph/task-lens.ts +29 -0
- package/src/compact/token-budget.ts +89 -74
- package/src/config/toml-loader.ts +9 -5
- package/src/dashboard/project-classification.ts +64 -64
- package/src/embedding/fastembed-provider.ts +142 -142
- 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/hooks/handler.ts +127 -66
- package/src/hooks/installers/index.ts +5 -4
- package/src/hooks/official-skills.ts +6 -4
- package/src/hooks/pattern-detector.ts +173 -173
- package/src/hooks/rules/memorix-agent-rules.md +9 -7
- package/src/hooks/significance-filter.ts +250 -250
- package/src/knowledge/context-assembly.ts +4 -1
- package/src/knowledge/workset.ts +89 -1
- 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/disclosure-policy.ts +135 -135
- package/src/memory/entity-extractor.ts +197 -197
- 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/refs.ts +94 -94
- package/src/memory/secret-filter.ts +79 -79
- package/src/memory/session.ts +158 -9
- 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 +343 -343
- 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/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/sdk.ts +299 -299
- 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 +144 -10
- package/src/skills/mini-skills.ts +386 -386
- package/src/store/bun-sqlite-compat.ts +118 -15
- package/src/store/chat-store.ts +119 -119
- package/src/store/graph-store.ts +249 -249
- package/src/store/mini-skill-store.ts +349 -349
- 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/sqlite-db.ts +3 -3
- package/src/team/event-bus.ts +76 -76
- package/src/team/file-locks.ts +173 -173
- package/src/team/handoff.ts +161 -161
- package/src/team/messages.ts +203 -203
- package/src/team/poll.ts +132 -132
- package/src/team/tasks.ts +211 -211
- 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,33 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [1.2.4] - 2026-07-26
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- **One-call continuation for CLI-only agents** -- Added `memorix resume "<task>"`, a direct terminal entry that returns the same bounded Memory Autopilot Workset as Project Context without requiring MCP discovery or command probing.
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
- **Continuation is a delivery choice, not a separate memory silo** -- Project Context now recognizes continuation language independently of its task lens. It adds only the latest meaningful session summary and up to three readable durable anchors, with source records in the existing context receipt. Ordinary new tasks remain free of old-session dumps.
|
|
12
|
+
- **Stable agent fallback guidance** -- Generated skills and rules now direct an agent with unavailable MCP to make exactly one task-aware CLI call: `memorix resume` for prior work or `memorix context` for a new task. Continuation requests must take that brief before local file/Git archaeology, and an absent `.memorix` directory is not treated as proof that no durable memory exists. This prevents broad command enumeration, repeated search loops, and false cold-start conclusions.
|
|
13
|
+
|
|
14
|
+
### Fixed
|
|
15
|
+
- **Claude continuation delivery** -- Claude Code now receives an explicit continuation's bounded prior-work Workset through its official `UserPromptSubmit.additionalContext` response, rather than relying on an advisory rule or a SessionStart message the host does not place in model context. `memory.inject = "silent"` still disables automatic injection.
|
|
16
|
+
- **Fresh-install SQLite resilience** -- When the optional `better-sqlite3` native binary is missing on a supported Node 22 runtime, Memorix now opens the same local `memorix.db` through Node's built-in SQLite instead of losing session and durable-memory reads across CLI or hook processes. No data migration or configuration change is required.
|
|
17
|
+
- **Standard TOML literal strings** -- Project and global configuration now accepts single-quoted TOML strings, including `#` characters inside the literal value.
|
|
18
|
+
- **MCP continuation summary parity** -- `memorix_project_context` now includes the same bounded prior-session and durable-memory evidence in `format: "summary"` as it does in the default prompt format, so agents that request a compact summary do not lose a valid handoff.
|
|
19
|
+
- **Actionable continuation anchors** -- Bounded continuation text no longer cuts a technical flag or symbol halfway through. The shared guidance also avoids redundant Context Pack/search/detail calls after a complete Autopilot brief, keeping the default agent path compact.
|
|
20
|
+
- **Autopilot duplicate retrieval** -- A completed MCP Project Context now holds a short-lived delivery boundary. Follow-up search/detail calls do not re-send memories already represented in that brief unless the user explicitly asks to inspect the underlying record.
|
|
21
|
+
- **Read-only memory mutation** -- A task that asks for read-only work or says not to modify files now rejects automatic `memorix_store` writes. An agent must have an explicit user request before it can override that boundary.
|
|
22
|
+
- **Prior-work privacy parity** -- Continuation retrieval applies the same project, team, and personal-memory visibility reader as session context, including canonical project aliases. A different identity cannot receive another agent's personal durable memory through the new delivery path.
|
|
23
|
+
- **Rule-surface drift** -- The shared automatic-memory rule file now carries the same one-call CLI fallback contract as setup-generated agent guidance.
|
|
24
|
+
|
|
25
|
+
## [1.2.3] - 2026-07-25
|
|
26
|
+
|
|
27
|
+
### Fixed
|
|
28
|
+
- **Session context now respects observation visibility** -- Automatic session handoff and manual session-context reads in the CLI, MCP server, and Workbench apply the caller's project, team, and personal-memory reader. A new identity cannot receive another agent's personal observations through session startup.
|
|
29
|
+
- **Identity before handoff** -- CLI and MCP coordination sessions establish their explicit identity before assembling prior context, so an owner's own personal records remain available while a newly joined agent fails closed.
|
|
30
|
+
- **Graph-side disclosure guard** -- Agent-facing session handoff no longer derives graph-neighbor hints from graph relations that do not yet carry observation visibility metadata.
|
|
31
|
+
|
|
5
32
|
## [1.2.2] - 2026-07-25
|
|
6
33
|
|
|
7
34
|
### Added
|
package/README.md
CHANGED
|
@@ -59,7 +59,7 @@ Memorix is more than a memory store. It also installs agent integrations, keeps
|
|
|
59
59
|
|
|
60
60
|
| Capability | What it does | Entry point |
|
|
61
61
|
| --- | --- | --- |
|
|
62
|
-
| Memory Autopilot | A bounded task Workset with start files, current memory, source-backed knowledge, workflow starts, cautions, and verification | `memorix context
|
|
62
|
+
| Memory Autopilot | A bounded task Workset with start files, current memory, source-backed knowledge, workflow starts, cautions, and verification | `memorix context "..."`, `memorix resume "..."`, `memorix_project_context` |
|
|
63
63
|
| Observation Memory | Searchable facts, fixes, gotchas, session summaries, and implementation notes scoped to the current Git project | `memorix memory`, MCP memory tools |
|
|
64
64
|
| Code State and Code Memory | Versioned local code snapshots, file/symbol links, and freshness checks. The built-in Lite index is always honest about its limits; an already-indexed local CodeGraph can add a bounded semantic outline | `memorix codegraph`, automatic context refresh |
|
|
65
65
|
| Git Memory | Commit-derived engineering facts that answer what changed, where, and why it matters | `memorix ingest commit`, git hook |
|
|
@@ -317,7 +317,7 @@ npm uninstall -g memorix
|
|
|
317
317
|
### Work from the CLI
|
|
318
318
|
|
|
319
319
|
```bash
|
|
320
|
-
memorix --cwd /path/to/repo
|
|
320
|
+
memorix --cwd /path/to/repo resume "continue release blocker"
|
|
321
321
|
memorix memory search --query "release blocker"
|
|
322
322
|
memorix memory --help
|
|
323
323
|
|
|
@@ -357,7 +357,7 @@ This opens memcode, a terminal coding agent that uses the same Memorix project m
|
|
|
357
357
|
|
|
358
358
|
Search is project-scoped by default. `scope="global"` searches across projects. The search boosts Git Memory for "what changed" questions and reasoning records for "why" questions.
|
|
359
359
|
|
|
360
|
-
`memorix context
|
|
360
|
+
`memorix context "..."` is the default Memory Autopilot entry. It builds a compact task-lensed brief for agents: bugfix tasks lean toward tests and repros, release tasks lean toward package/changelog/build checks, onboarding tasks lean toward docs and entry points, and stale or unrelated memories stay in warning lanes instead of flooding the prompt. A normal new task does not receive an old-session dump. For an explicit continuation, `memorix resume "..."` adds only the latest useful session summary and up to three readable durable anchors. Agents should read the suggested files before trusting stored memory.
|
|
361
361
|
|
|
362
362
|
<h2 id="runtime-modes"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-runtime.svg"><img src="assets/tags/section-runtime.svg" alt="Runtime Modes" height="32" /></picture></h2>
|
|
363
363
|
|
package/README.zh-CN.md
CHANGED
|
@@ -59,7 +59,7 @@ Memorix 不只是一个记忆库。它还负责安装 Agent 接入、保留有
|
|
|
59
59
|
|
|
60
60
|
| 能力 | 作用 | 入口 |
|
|
61
61
|
| --- | --- | --- |
|
|
62
|
-
| Memory Autopilot | 给新 Agent session 一份有预算的任务 Workset,包含起步文件、当前记忆、来源知识、工作流首步、风险提示和验证建议 | `memorix context
|
|
62
|
+
| Memory Autopilot | 给新 Agent session 一份有预算的任务 Workset,包含起步文件、当前记忆、来源知识、工作流首步、风险提示和验证建议 | `memorix context "..."`、`memorix resume "..."`、`memorix_project_context` |
|
|
63
63
|
| Observation Memory | 当前 Git 项目内可检索的事实、修复、坑点、session 摘要和实现记录 | `memorix memory`、MCP memory tools |
|
|
64
64
|
| Code State 和 Code Memory | 可版本化的本地代码快照、文件 / symbol 关联和 freshness 检查。内置 Lite 会如实说明边界;已有本地索引的 CodeGraph 可额外给出有预算的语义关系 | `memorix codegraph`、自动 context refresh |
|
|
65
65
|
| Git Memory | 从 commit 中提取工程事实,回答改了什么、在哪里改、为什么重要 | `memorix ingest commit`、git hook |
|
|
@@ -317,7 +317,7 @@ npm uninstall -g memorix
|
|
|
317
317
|
### 从 CLI 管理记忆
|
|
318
318
|
|
|
319
319
|
```bash
|
|
320
|
-
memorix --cwd /path/to/repo
|
|
320
|
+
memorix --cwd /path/to/repo resume "继续处理发布阻塞问题"
|
|
321
321
|
memorix memory search --query "release blocker"
|
|
322
322
|
memorix memory --help
|
|
323
323
|
|
|
@@ -357,7 +357,7 @@ memcode
|
|
|
357
357
|
|
|
358
358
|
默认搜索当前项目。`scope="global"` 可以跨项目搜索。“改了什么”优先匹配 Git Memory,“为什么”优先匹配 reasoning / decision 记录。
|
|
359
359
|
|
|
360
|
-
`memorix context
|
|
360
|
+
`memorix context "..."` 是默认的 Memory Autopilot 入口。它会按任务生成紧凑 brief:修 bug 时偏向测试和复现,发版时偏向 package/changelog/build 检查,接手项目时偏向文档和入口文件;过期或不相关的记忆只作为 warning,不会一股脑塞进 prompt。普通新任务不会自动得到旧会话的文本倾倒;明确要继续之前工作时,用 `memorix resume "..."`,只会补入最近一份有用的会话总结和最多三条当前可读的长期记忆锚点。Agent 应该先读 suggested files,再相信历史记忆。
|
|
361
361
|
|
|
362
362
|
<h2 id="运行模式"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-runtime.svg"><img src="assets/tags/section-runtime.svg" alt="运行模式" height="32" /></picture></h2>
|
|
363
363
|
|
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)` |
|