Skip to content

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

Merged
zlareb1 merged 5 commits into
mainfrom
docs/team-namespace
Dec 5, 2026
Merged

zlareb1 merged 5 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 string tool fields 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 tool field that is not a string is in the narrative as its JSON text, so the page calls only an observation's string tool fields plain text.
  • 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.
  • The owner's automatic proposal policy only rejects, and an acceptance is an administrator's memory.proposal_decide (server/memory/app/proposals.py). The audit recipe's sentence therefore says which caller writes which row: an administrator's decision leaves a memory.proposal_accept or a memory.proposal_reject row, the policy a memory.proposal_reject row.

Scope and risk

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

The branch holds a merge of main, which conflicts in one row of the README's hook table, loom-session-memory.mjs. The row keeps main's sentence on the test cost row that the SessionEnd hand-off carries, and this change's caps on the turns it sends. Every other row of that table is main's.

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, after the merge of main, with pytest -n 2:

  • tests/unit/test_doc_links.py tests/unit/test_public_copy.py tests/unit/test_agent_instructions.py tests/unit/test_agent_plugin.py tests/unit/test_plugin_agrees_with_server.py: 522 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. Against main, the README's two tables differ in the three edited rows only.
  • python -m scripts.codegen.agent_plugin_sync --check, standalone_skills --check and served_skills --check: current.

What ran at the head before the merge, and not again:

  • The other tests that read the edited pages or the plugin README (test_published_links.py, test_mcp_listing_budget.py, test_gemini_extension.py, test_i18n_context.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): they passed, in a run of 955 tests with the two plugin tests above.
  • make typecheck: pass. python scripts/codegen/docs_reference.py --check and settings_reference.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 later commits change 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 statements the later commits add, 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 field and wrote its escape for one inside an object or a list.
  • make typecheck, ruff check and the two reference generators' checks at this head: the merge and the commit after it change no Python file and no generated page, so the tree's Python is main's.
  • 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 gaps named under "Not run": make lint and make format-check stop on tools this machine lacks, and the type check ran before the merge.

🤖 Generated with Claude Code


Note

Low Risk
Prose-only changes with no wire, schema, or runtime behavior changes; risk is limited to possible documentation inaccuracies.

Overview
Documentation-only update across nine docs/ pages and the Claude Code plugin README so teams sharing one namespace can predict how search scope, packs, guides, counters, blacklist matching, extraction, run retention, and plugin hooks actually behave—statements were aligned with the server and plugin code.

Search and multi-namespace reads: identities-and-namespaces.md replaces a vague “same fan-out” claim with a table of default namespace_scope per reader (memory.search/memory.ask, loom_search, context.pack with vs without query) and clarifies that scoped-token tiered search stops at the first namespace (including the addressed one) whose best match hits LOOM_MEMORY_SEARCH_TIER_STOP_SIMILARITY.

Team namespace guide: New “A namespace a team shares” section covers setup (newest_wins, MCP agent/actor semantics, kinds as tags), plus insights.query and audit.list recipes for weekly writers and proposal acceptance. Namespace guide delivery is spelled out (200-token/800-character budget, section_token_budgets, truncated text pointing at namespace.guide_get); the MCP primer is documented as not containing the guide.

Memory, refusal, and plugins: Blacklist patterns on writes match stored JSON (escapes, regex anchoring on "); observe/decision paths use plain text. Coding-plugin file block requires repo: tags on session-namespace rows; recall_count / recent_recalls stay at 0 without a named consumer, with what still moves (served_count, health, evidence_count). Extraction notes coverage_sweep and per-call extraction_instructions under operator policy. Run retention and SessionEnd hand-off caps, LOOM_OBSERVE_SKIP_TOOLS replacement semantics, and LOOM_CONFIG_FILE for headless multi-bot tokens are documented in the plugin README and related guides.

Reviewed by Cursor Bugbot for commit 9a9d921. 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 5:26am UTC
loom-telemetry Ready Ready Preview Dec 5, 2026 5:26am UTC

Request Review

zlareb1 and others added 4 commits December 5, 2026 04:40
…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>
…plain text a pattern matches

An observation's narrative holds a tool input or output that is not a string
as its JSON text, where a non-ASCII character is its escape. The Limits bullet
called the whole narrative plain text, which contradicts the blacklist section
it links to. It names the string tool fields, as that section does.

Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
integrations/claude-code-plugin/README.md conflicts in the hook table, in
the `loom-session-memory.mjs` row. The row keeps main's sentence on the test
cost row that the SessionEnd hand-off carries, and this branch's bounds on
the turns it sends: the last 200, each cut at 6,000 characters, the oldest
dropped until the text fits 120,000 characters (`MAX_TURNS`,
`MAX_MESSAGE_CHARS` and `MAX_TOTAL_CHARS` in `lib/session-memory.mjs`).
Every other row of the table is main's.

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

The section on a namespace a team shares counts accepted and rejected
proposals from the audit trail. The owner's automatic policy only rejects,
at `reject_after_fails` failed graded runs, and an acceptance is an
administrator's `memory.proposal_decide`. The sentence on where the audit
rows come from says which caller writes which row, as the `proposal_policy`
row of the same page does: an administrator's decision leaves a
`memory.proposal_accept` or a `memory.proposal_reject` row, the policy a
`memory.proposal_reject` row.

Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@zlareb1
zlareb1 merged commit 4739fdf into main Dec 5, 2026
85 of 86 checks passed
@zlareb1
zlareb1 deleted the docs/team-namespace branch December 5, 2026 05:33
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