Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion integrations/claude-code-plugin/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "loom",
"displayName": "ClickHouse Loom",
"version": "1.2.187",
"version": "1.2.189",
"description": "Shared long-term memory and code intelligence for Claude Code, self-hosted on ClickHouse. MCP tools to save and recall decisions, preferences and corrections across sessions and teammates; lifecycle hooks that capture each session with no model call; a code index that answers where-is, who-calls and blast-radius questions with line-accurate units instead of whole-file reads.",
"author": {
"name": "ClickHouse"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ hint to the user unless it changes what you are about to do.
| know before deciding what the store already holds | `context.pack` once at session start (working memory, profile, relevant memories, procedures); `memory.search` / `loom_search` before a decision; `memory.brief` to orient on one question | writing without reading |
| a `memory.get` says `found: false` | `memory.search` (by meaning), `memory.list prefix=` (the siblings); a moved key answers with `canonical_key` — pass `follow=true` | inventing the key again |
| a write came back with `duplicate_of` or `conflict` | read the named row (`memory.get`, `memory.related`), revise THAT key, or `memory.link supersedes` if yours replaces it; a `conflict` → tell the user both values (`loom-memory`) | writing a third copy |
| the namespace holds facts that disagree | `conflicts.list` (over HTTP/SDK; the dashboard's Review queue) → `conflicts.resolve`; search penalises conflicted rows until then | leaving them |
| the namespace holds facts that disagree | `conflicts.list` (over HTTP/SDK; the dashboard's Review queue) → `conflicts.resolve`; search penalises conflicted rows until then; two definitions of one name: `memory.definitions.disputes` (via `loom_op`) | leaving them |
| follow what is connected to an entity | `facts.traverse` from a seed entity, `facts.path` between two names (via loom_op), `memory.related` for a row's neighbours | a chain of searches |
| do a piece of work whose outcome should grade the memories it used | `run.begin` before, its `run_id` on writes (`memory.set`, `observe.record`; reads carry the session's run), `run.complete(memories_used=[…], outcome=…)` after — callable via `loom_op` | nothing; the store cannot tell which memories helped |
| make a decision that a future session should be able to check | `decision.record` (scenario, options, choice), later `decision.outcome`; `decision.precedents` before a similar decision — callable via `loom_op` | a memory row that says "we decided X" |
Expand Down
2 changes: 1 addition & 1 deletion integrations/codex-plugin/.codex-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "loom",
"version": "1.2.187",
"version": "1.2.189",
"description": "Shared long-term memory and code intelligence for Codex, self-hosted on ClickHouse. MCP tools to save and recall decisions, preferences and corrections across sessions and teammates; lifecycle hooks that capture each session with no model call; a code index that answers where-is, who-calls and blast-radius questions with line-accurate units instead of whole-file reads.",
"author": {
"name": "ClickHouse"
Expand Down
2 changes: 1 addition & 1 deletion integrations/codex-plugin/skills/loom-mentor/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ hint to the user unless it changes what you are about to do.
| know before deciding what the store already holds | `context.pack` once at session start (working memory, profile, relevant memories, procedures); `memory.search` / `loom_search` before a decision; `memory.brief` to orient on one question | writing without reading |
| a `memory.get` says `found: false` | `memory.search` (by meaning), `memory.list prefix=` (the siblings); a moved key answers with `canonical_key` — pass `follow=true` | inventing the key again |
| a write came back with `duplicate_of` or `conflict` | read the named row (`memory.get`, `memory.related`), revise THAT key, or `memory.link supersedes` if yours replaces it; a `conflict` → tell the user both values (`loom-memory`) | writing a third copy |
| the namespace holds facts that disagree | `conflicts.list` (over HTTP/SDK; the dashboard's Review queue) → `conflicts.resolve`; search penalises conflicted rows until then | leaving them |
| the namespace holds facts that disagree | `conflicts.list` (over HTTP/SDK; the dashboard's Review queue) → `conflicts.resolve`; search penalises conflicted rows until then; two definitions of one name: `memory.definitions.disputes` (via `loom_op`) | leaving them |
| follow what is connected to an entity | `facts.traverse` from a seed entity, `facts.path` between two names (via loom_op), `memory.related` for a row's neighbours | a chain of searches |
| do a piece of work whose outcome should grade the memories it used | `run.begin` before, its `run_id` on writes (`memory.set`, `observe.record`; reads carry the session's run), `run.complete(memories_used=[…], outcome=…)` after — callable via `loom_op` | nothing; the store cannot tell which memories helped |
| make a decision that a future session should be able to check | `decision.record` (scenario, options, choice), later `decision.outcome`; `decision.precedents` before a similar decision — callable via `loom_op` | a memory row that says "we decided X" |
Expand Down
36 changes: 36 additions & 0 deletions tests/unit/test_agent_instructions.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
BUNDLES = sorted(
ROOT / p for p in TRACKED if re.fullmatch(r"skills/loom-(memory|code|status)/[^/]+\.md", p)
)
# The plugin skill that routes a situation to an op; the Codex copy is synced from it.
MENTOR_SKILL = ROOT / "integrations" / "claude-code-plugin" / "skills" / "loom-mentor"
NAME = re.compile(r"^[a-z0-9]+(-[a-z0-9]+)*$")
# The open skill format caps a description at 1024 characters.
MAX_DESCRIPTION = 1024
Expand Down Expand Up @@ -236,6 +238,40 @@ def test_a_bundle_names_only_ops_and_tools_the_server_serves(doc: Path) -> None:
assert not unknown, f"no such MCP tool: {sorted(unknown)}"


def test_the_mentor_skill_names_only_ops_the_server_serves() -> None:
"""The mentor skill sends an agent to an op by name. A name the registry lacks, or
the read of differing definitions refused by `loom_op`, leaves the agent with a
refusal where the skill promised an answer."""
from server.operations.registry import OPERATIONS_BY_NAME
from server.transport import mcp_op

groups = {name.split(".")[0] for name in OPERATIONS_BY_NAME}
named: dict[str, set[str]] = {}
for file in ("SKILL.md", "reference.md"):
mentions = operation_mentions((MENTOR_SKILL / file).read_text(), groups)
named[file] = {m.name for m in mentions if m.kind == "op"}
assert named[file], f"loom-mentor/{file} names no op"
unknown = named[file] - OPERATIONS_BY_NAME.keys()
assert not unknown, f"loom-mentor/{file}: no such op: {sorted(unknown)}"
# Routing is asserted for this op alone: the row that names it also names
# `conflicts.list`, which is kept off MCP and says so.
disputes = "memory.definitions.disputes"
assert disputes in named["reference.md"]
call = {
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": mcp_op.LOOM_OP_TOOL_NAME,
"arguments": {"op": disputes, "arguments": {}},
},
}
# A read-only connection routes the fewest ops.
rewritten, refusal = mcp_op.route(call, toolset="readonly", auth=None)
assert refusal is None, refusal
assert rewritten["params"]["name"] == OPERATIONS_BY_NAME[disputes].mcp_tool_name


def _matches(rule: str, command: str, strip_env: bool = True) -> bool:
"""This test's model of Claude Code's Bash rule match: `:*` and `*` are any text.

Expand Down
Loading