Skip to content

The docs say what a team namespace's sessions, packs, counters and policies do - #2200

Open
zlareb1 wants to merge 2 commits into
mainfrom
docs/team-namespace
Open

zlareb1 wants to merge 2 commits into
mainfrom
docs/team-namespace

Conversation

@zlareb1

@zlareb1 zlareb1 commented Dec 5, 2026 •

Copy link
Copy Markdown
Member

Related: #1232

Changelog category (leave one):

  • Documentation (changelog entry is not required)

Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):

Not required.

Why

A team that shares one namespace cannot predict ten behaviours from the pages: one statement contradicts the code, and nine leave out what a reader needs. Each fix is a paragraph and one reader's path crosses all of them, so they are one change.

Page What it says now
docs/concepts/identities-and-namespaces.md What a call with no namespace_scope reads, per reader. memory.search and memory.ask read this unless the deployment's default is all_mine. loom_search reads all_mine. context.pack takes no scope. With a query, its memories section is a search that follows the deployment's default; with none, a startup pack lists the addressed namespace's pinned and newest rows whatever the default. Its knowledge and conversations sections read all_mine. The page said loom_search and context.pack use the same fan-out. A scoped token's tiered search stops at the first namespace whose best match reaches LOOM_MEMORY_SEARCH_TIER_STOP_SIMILARITY (0.40).
docs/features/namespaces-and-sharing.md, docs/features/integrations/mcp-clients.md The guide section's 200 tokens are 800 characters with its head line. A guide that is cut names namespace.guide_get in that line. section_token_budgets raises the budget for one call. The MCP primer holds no guide.
docs/features/memory/writing.md The coding plugins' file block asks the session's namespace by the checkout's repo:<id> tags, so a row saved with files and without the tag is not in it, and which writers add the tag.
docs/features/observability/cost-and-usage.md For a team on the coding plugins: why recall_count and namespace.summary's recent_recalls stay at 0, what a named consumer changes, and which figures do move.
docs/features/memory/conflicts-and-refusal.md On memory.set, memory.update and the bulk and extraction paths a blacklist pattern is matched against the value's stored JSON text, with the escapes a substring and a regex must spell. An observation's narrative and a decision's fields are matched as plain text, so a pattern for a non-ASCII word, a quote or a line break is added in both spellings.
integrations/claude-code-plugin/README.md, docs/features/memory/retention-and-erasure.md The SessionEnd hand-off's caps. A LOOM_OBSERVE_SKIP_TOOLS value replaces the default list. run.complete's retain deletes nothing, keeps episodic and reflection rows, and acts when the run closes.
docs/features/namespaces-and-sharing.md A section, "A namespace a team shares": a setup recipe, whose row a write over MCP is, what newest_wins does for several writers, kinds as tags, what a later namespace.register needs, and two monitoring recipes (writers per week from insights.query, the share of proposals accepted from audit.list).
docs/features/memory/extraction.md Two settings that get more facts under an operator policy: coverage_sweep on the namespace and a call's extraction_instructions.
docs/guides/headless-bots.md How each bot on a runner that keeps its home directory gets its own token: LOOM_CONFIG_FILE, or the MCP entry mounted beside the plugin.

Each statement was read in the code first. Where the code says more than the gap this change set out to close, the page follows the code:

  • A recall credit is written by the memory search loom_search runs as well as by memory.search. The cost page therefore says what a credit needs (a named consumer, and a run, a session or a closer), not that one op alone credits. recent_recalls does count memory.search calls alone.
  • memory.for_file names no agent, so the plugins' pre-edit block adds a served row only for a named consumer.
  • A memory.set that merges into a stored row raises evidence_count only under auto_reinforce. A memory.bulk_set entry raises it under newest_wins too, and an extraction that restates a stored row records the same event (server/memory/app/pipeline.py, _reinforce_restated).
  • The file block's tag filter applies to the session's namespace. Rows of the repository's primary code namespace are read without it.
  • Run retention is applied once, when run.complete runs. Nothing on main applies it to a row written later, so both pages say a fact extracted after the run closed is not touched.
  • created_at in the memory table that insights.query reads is the row's first write. The weekly recipe therefore counts new memories, under the actor of each row's current version.
  • A regex pattern with a lone \u is refused as an invalid pattern, so the page shows the escaped form.
  • observe.record checks the narrative it builds and decision.record its fields joined as text, neither as stored JSON, so the blacklist paragraph names the paths that match the stored text and the two that do not.
  • A context.pack with no query runs no search: a startup pack lists the addressed namespace's rows and another mode has no memories section, so the deployment's default scope applies only to a pack with a query.

Scope and risk

Touches nine pages under docs/ and integrations/claude-code-plugin/README.md: 195 lines added, 14 removed. No code, no test and no generated page changes.

Left alone:

  • The pack section that serves other namespaces' text, the proposal policy's wording and the dashboard's own texts: other changes own them.
  • docs/reference/ (generated) and i18n/ (the translation workflow reads the English pages after the merge).
  • The plugin manifests: the README is not a file a plugin ships, so no version is bumped.

What could break: a statement that is wrong. Each was checked against the code, and the first commit's statements that a request can show were also checked against a local server (Tests). No hook, op, stored row or permission changes.

Compatibility, rollout and rollback

  • Wire: no op, field, table, column, migration or setting is added, changed or removed.
  • Operator steps: none.
  • Rollback: a revert restores the previous text and leaves nothing behind.

Tests

No new test: the change is prose, and the existing docs tests cover links, anchors, public copy and the paths the agent instructions name.

What ran at this head, with pytest -n 2:

  • tests/unit/test_doc_links.py tests/unit/test_public_copy.py tests/unit/test_agent_instructions.py: 516 passed.
  • The tests that read the edited pages or the plugin README (test_published_links.py, test_mcp_listing_budget.py, test_agent_plugin.py, test_gemini_extension.py, test_i18n_context.py, test_plugin_agrees_with_server.py, test_docs_reference.py, test_settings_reference.py, test_environment_reference.py, test_help_docs.py, test_markdown_links.py, test_assistant_help_citations.py, test_stock_env_matches_docs.py, test_codex_plugin.py, test_cursor_plugin.py, test_i18n.py, test_page_summary.py, test_sdk_readme_facts.py, test_instructions_lint.py, test_error_help_link.py, test_benchmark_publication_copy.py): 955 passed.
  • The repository-wide scans (test_package_contracts.py, test_op_transport_contract.py, test_tunable_constants.py, test_store_names_refused.py, test_degraded_unnoted.py) and tests/analyzer: 85 passed, 12 skipped.
  • npx prettier@3.9.9 --check and ruff format --check (which formats the Python blocks in Markdown) on the ten files: pass. In the README's two tables only the three edited rows differ.
  • make typecheck: pass. python scripts/codegen/docs_reference.py --check, settings_reference.py --check and agent_plugin_sync.py --check: current.

The recipes and the statements a request can show were run once, at the branch's first commit, against a server started from this tree on a ClickHouse started for the task, with the fake embedder and the fake model provider, and removed afterwards. Their output is not committed, and the second commit changes no recipe. What they showed:

  • The three Python blocks of the new section run as written, with a token and with sign-in off. On a namespace with two writers and three decided proposals the weekly statement printed one week with 2 writers and 4 memories, and the audit recipe printed 2 of 3 proposals accepted. Both ops answer a writer's token as well as an administrator's.
  • Two MCP sessions under different client names wrote one key as two rows, agent the client's slug and user_id and session_id -. Under newest_wins the older row became superseded; under the default policy both stayed active. Two people on one client wrote one row.
  • namespace.register on an existing namespace without owner_email answered 422, and one that left out tags cleared them.
  • A guide longer than the budget came back in a pack as 798 characters with namespace.guide_get named in its head line, and as 2,399 with section_token_budgets {"namespace_guide": 600}, over HTTP and through the loom_context_pack tool. The initialize instructions and loom_activate held no guide text.
  • Counters: a context.pack read added a served row and no recall credit. memory.for_file added a served row only with a consumer named, and returned nothing for a tag the row lacks. A memory.search with no consumer answered not_credited; a consumer that had posted run.complete was credited, and so was loom_search over MCP under a token minted with --consumer. recent_recalls counted the memory.search calls only.
  • Blacklist, on memory.set: the substring café did not refuse a value that holds it and caf\u00e9 did; the same for a quote, a line break and a backslash by their escapes; ^"secret matched where ^secret did not; a substring in another case did not match and (?i) did.

Not run:

  • The two statements the second commit adds, against a server. That a startup pack with no query lists the addressed namespace alone whatever the default scope is read from _pack_memories and _pack_startup_recall in server/memory/app/context_pack.py. That observe.record and decision.record match other text is read from server/memory/app/observe.py and decision.py; the narrative builder, called in process, kept café from a string tool output and wrote its escape for one inside an object input.
  • make lint to its end: it stops at the Rust SDK generator's check, which needs rustfmt, a tool this machine does not have. The steps before it pass (ruff check, the function-length and secret gates, the Python, TypeScript and Ruby SDK generators), and the three generator checks named above were run alone.
  • make format-check as a whole (it needs shfmt); the two formatters that read Markdown were run on the changed files.
  • The documentation site build, the full unit suite and the integration suite: CI runs them.
  • A SessionEnd hand-off from a live client: the caps and the order of the run's close and the extraction are read from lib/session-memory.mjs, lib/run-hook.mjs and server/memory/app/run_retention.py.

AI assistance in the code (leave one; writing this description with AI is fine):

  • AI-generated (an agent wrote most of the diff): Claude Code wrote the text, read each statement in the code and ran the checks listed under Tests.

  • I can explain every line of this diff and how it interacts with the rest of Loom.

Checklist

  • Local format, lint, type checks and focused tests pass. The full make test-unit and applicable integration results are reported by CI; a full local run is not required before pushing.
  • Generated files are regenerated in this PR, not by hand: the SDK op tables, docs/reference/configuration.md and the docs/reference/ tables (python scripts/codegen/docs_reference.py), the reach manifest, schemas/schema.sql (make schema-dump), the Codex plugin copies (python3 scripts/codegen/agent_plugin_sync.py) and the standalone skill bundles (python3 scripts/codegen/standalone_skills.py).
  • A new migration is additive and numbered after the latest on main; no merged migration is edited.
  • A behaviour change to any file a plugin ships (hooks/, lib/, bin/, skills/, .mcp.json, the Codex plugin-defaults.json) bumps both plugin manifests' version, and no other open PR uses that version.
  • The frontend builds (npm --prefix frontend run build) and its tests pass, if frontend/ changed.
  • Docs under docs/ describe the system as it now is, and this description names any operator steps and wire changes.
  • Repository text has no dates, people, host names, internal namespaces, ticket or decision numbers; the history goes in this description (tests/unit/test_public_copy.py).
  • Commits are signed off (git commit -s), as CONTRIBUTING.md asks.
  • I signed the Contributor License Agreement (CLA) if CLA assistant requested a signature.

Unticked: this change has no generated file, no migration, no shipped plugin file and no frontend file, so those four checks do not apply; the CLA line is the committer's to confirm. The first box is ticked with the two gaps named under "Not run": make lint and make format-check stop on tools this machine lacks.

🤖 Generated with Claude Code


Note

Low Risk
Prose-only changes across nine doc files and the plugin README; no wire, runtime, or permission changes. Residual risk is incorrect documentation statements, which the author validated against code and a local server.

Overview
Documentation-only updates so teams sharing one namespace can predict MCP sessions, packs, search fan-out, counters, and policies without reading the code.

Namespace scope and search — identities-and-namespaces.md replaces a vague “same fan-out” claim with a table of default namespace_scope per reader (memory.search/ask, loom_search, context.pack, memory.for_file) and documents scoped-token tiered search stopping at the first namespace whose best match hits LOOM_MEMORY_SEARCH_TIER_STOP_SIMILARITY (0.40).

Guides and MCP primer — namespaces-and-sharing.md and mcp-clients.md spell out the namespace_guide pack budget (200 tokens ≈ 800 characters), truncation with namespace.guide_get, section_token_budgets, and that the MCP primer does not include the guide (pack or namespace.guide_get instead).

Team namespace guide — New section in namespaces-and-sharing.md: register shared namespace, MCP write identity (agent slug, actor), newest_wins vs default conflict policy, kinds as tags, namespace.register tag replacement, and monitoring recipes (insights.query writers/week, audit proposal accept rate).

Coding plugins and counters — writing.md explains repo: tags and the file block; cost-and-usage.md explains why recall_count / recent_recalls stay at 0 without a named consumer and what still moves (served_count, health stats, evidence_count).

Blacklist, retention, extraction, headless bots — conflicts-and-refusal.md documents JSON-stored value matching vs plain text on observe/decision; retention-and-erasure.md and the Claude Code README clarify run.complete retain, SessionEnd caps, LOOM_OBSERVE_SKIP_TOOLS replacing (not appending) defaults; extraction.md adds coverage_sweep and extraction_instructions under operator policy; headless-bots.md documents per-bot tokens via LOOM_CONFIG_FILE or strict MCP mount.

Reviewed by Cursor Bugbot for commit b0469c3. Bugbot is set up for automated code reviews on this repo. Configure here.

…licies do

A team that shares one namespace could not predict these behaviours from the
pages, and one statement contradicted the code.

- identities-and-namespaces: loom_search reads all_mine by default, a pack's
  memories section follows the deployment's default scope, and a scoped
  token's tiered search stops at the first namespace whose best match reaches
  the tier stop similarity. loom_search and context.pack do not share one
  fan-out.
- namespaces-and-sharing, mcp-clients: the guide section's budget in
  characters, the field that raises it per call, and that the MCP primer holds
  no guide.
- writing: the coding plugins' file block asks by the checkout's repo tags.
- cost-and-usage: which counters move for a team on the coding plugins, and
  why recall_count stays at 0 without a named consumer.
- conflicts-and-refusal: a blacklist pattern is matched against the value's
  stored JSON text.
- the Claude Code plugin README, retention-and-erasure: the hand-off's caps,
  LOOM_OBSERVE_SKIP_TOOLS replaces the default list, and run retention deletes
  nothing and acts when the run closes.
- namespaces-and-sharing: a section for a namespace a team shares, with a
  setup recipe and two monitoring recipes.
- extraction: two settings that get more facts under an operator policy.
- headless-bots: how each bot on a shared runner gets its own token.

Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@vercel

vercel Bot commented Dec 5, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
loom-docs Ready Ready Preview Dec 5, 2026 4:43am UTC
loom-telemetry Ready Ready Preview Dec 5, 2026 4:43am UTC

Request Review

…tch a pattern as plain text

- docs/concepts/identities-and-namespaces.md: a `context.pack` with a `query` searches
  memory under the deployment's default scope. With none, a `startup` pack lists the
  addressed namespace's pinned and newest rows whatever the default, and a pack in another
  mode has no `memories` section.
- docs/features/memory/conflicts-and-refusal.md: a blacklist pattern is matched against
  the stored JSON text on `memory.set`, `memory.update` and the bulk and extraction paths.
  `observe.record` checks a narrative that holds a string tool field as sent, and
  `decision.record` checks its fields as plain text, so a pattern for a non-ASCII word, a
  quote or a line break is added in both spellings.
- docs/features/namespaces-and-sharing.md: the sentence that the MCP primer holds no guide
  follows the list of ways the guide reaches agents.

Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant