From 8a32beede05e57f3b50535aa21d4013598d17e04 Mon Sep 17 00:00:00 2001
From: Shaun Struwig <41984034+Blargian@users.noreply.github.com>
Date: Thu, 19 Nov 2026 21:17:24 +0100
Subject: [PATCH 01/16] Documentation defaults to dark with a wider reading
column
The prose column uses more of the space between navigation and the page outline.
Signed-off-by: Shaun Struwig <41984034+Blargian@users.noreply.github.com>
---
docs/theme.css | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/theme.css b/docs/theme.css
index 3eec518939..043b9c0343 100644
--- a/docs/theme.css
+++ b/docs/theme.css
@@ -10,7 +10,7 @@
--blume-action-foreground: var(--blume-accent-foreground);
--blume-code-background: var(--click-global-color-background-muted, #282828);
--blume-radius: 0.5rem;
- --blume-content-width: 44rem;
+ --blume-content-width: 54rem;
}
:root[data-theme="dark"] .loom-logo-background,
From 2e1fd6dab2a67f3d990bb03c87353e66e2595034 Mon Sep 17 00:00:00 2001
From: Shaun Struwig <41984034+Blargian@users.noreply.github.com>
Date: Tue, 24 Nov 2026 14:26:20 +0100
Subject: [PATCH 02/16] Retire GitHub Pages documentation
Published documentation links and metadata point at the current documentation site, and translation finalization no longer dispatches the retired publisher.
Signed-off-by: Shaun Struwig <41984034+Blargian@users.noreply.github.com>
---
.github/workflows/docs-site.yml | 54 +---------------
.github/workflows/i18n.yml | 9 ++-
docs/development/documentation-style.md | 6 +-
docs/development/repository-guide.md | 2 +-
docs/development/testing.md | 9 +--
docs/index.md | 2 +-
mkdocs.yml | 8 +--
scripts/docs_site/overrides/main.html | 32 ----------
scripts/i18n/automation.py | 31 +---------
tests/unit/test_i18n_automation.py | 82 +++----------------------
10 files changed, 28 insertions(+), 207 deletions(-)
delete mode 100644 scripts/docs_site/overrides/main.html
diff --git a/.github/workflows/docs-site.yml b/.github/workflows/docs-site.yml
index d1e1c5914a..f57de3d012 100644
--- a/.github/workflows/docs-site.yml
+++ b/.github/workflows/docs-site.yml
@@ -1,6 +1,6 @@
name: docs site
-# Publishes legacy redirects and submits changed site URLs after production deploys.
+# Submits changed production documentation URLs after deployment.
on:
push:
branches: [main]
@@ -25,54 +25,6 @@ concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
- build:
- name: build
- runs-on: ubuntu-latest
- timeout-minutes: 15
- permissions:
- contents: read
- pages: read # Read the base URL used by the legacy Markdown copies.
- steps:
- - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- with:
- persist-credentials: false
- - uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
- with:
- python-version: "3.12"
- - name: Install the site builder
- run: |
- python -m pip install --require-hashes --no-deps --only-binary=:all: -r scripts/docs_site/requirements.txt
- - if: github.ref == 'refs/heads/main' && vars.DOCS_SITE_ENABLED == 'true'
- name: Read the legacy Pages URL
- id: pages
- uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0
- - name: Build legacy documentation redirects
- env:
- LOOM_LEGACY_DOCS_URL: ${{ steps.pages.outputs.base_url || 'https://loom.clickhouse.com/docs' }}/
- run: |
- mkdocs build --strict
- python -m scripts.docs_site.redirect_pages site "$LOOM_LEGACY_DOCS_URL"
- - if: github.event_name != 'pull_request'
- uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
- with:
- path: site
-
- deploy:
- name: deploy
- if: github.ref == 'refs/heads/main' && vars.DOCS_SITE_ENABLED == 'true'
- needs: build
- runs-on: ubuntu-latest
- timeout-minutes: 10
- permissions:
- pages: write # Deploy the built Pages artifact.
- id-token: write # Authenticate the Pages deployment.
- environment:
- name: github-pages
- url: ${{ steps.deployment.outputs.page_url }}
- steps:
- - id: deployment
- uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5.0.1
-
indexnow:
name: indexnow
if: github.ref == 'refs/heads/main'
@@ -95,8 +47,8 @@ jobs:
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
- # Legacy redirect publication has its own result. Only a successful IndexNow
- # job advances the comparison point so the next run covers a failed submission.
+ # Only a successful IndexNow job advances the comparison point so the next run
+ # covers a failed submission.
base=
page=1
while [[ -z "$base" ]]; do
diff --git a/.github/workflows/i18n.yml b/.github/workflows/i18n.yml
index 1fcda7179f..a48f8441f0 100644
--- a/.github/workflows/i18n.yml
+++ b/.github/workflows/i18n.yml
@@ -118,10 +118,15 @@ jobs:
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: "3.12"
- - name: Install the site builder
+ - name: Install the translation parser
run: |
python -m pip install --require-hashes --no-deps --only-binary=:all: -r scripts/docs_site/requirements.txt
- - name: Merge the successful exact head and publish the site
+ - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
+ with:
+ node-version: "22.19"
+ - name: Install the documentation builder
+ run: npm ci --prefix docs
+ - name: Merge the successful exact head
env:
GH_TOKEN: ${{ github.token }}
LOOM_I18N_LANGUAGES: ${{ vars.LOOM_I18N_LANGUAGES }}
diff --git a/docs/development/documentation-style.md b/docs/development/documentation-style.md
index f2be8a4de2..daae8f39af 100644
--- a/docs/development/documentation-style.md
+++ b/docs/development/documentation-style.md
@@ -96,7 +96,8 @@ These pages are rendered from the code. Edit the source, then run the generator.
| [reference/status.md](../reference/status.md) | op `maturity` and the boolean settings of `server/settings/catalog.py` that load false | `python scripts/codegen/docs_reference.py` |
| [reference/schema.md](../reference/schema.md) | `schemas/schema.sql` | `python scripts/codegen/docs_reference.py` |
-On the documentation site, `scripts/docs_site/hooks.py` serves each page's Markdown copy beside the page, at its URL plus `index.html.md` and, for a section index, at `.md`, named by a `` tag on the page; `llms.txt` with its links pointing at those copies; `llms-full.txt` (the pages that say what Loom is and how to start); and the repository's `llms-install.md`.
+On the documentation site, Blume serves each page's Markdown copy beside the page and
+publishes `llms.txt`, `llms-full.txt`, and the repository's `llms-install.md`.
The site publishes generated pages from `i18n//docs/` under `//`. English is the canonical default. Each page keeps its docs-relative path under `//`, so the homepage and use-case index have distinct routes. The English homepage links to each available translated homepage, or to its translated use-case index when the homepage is unavailable. Each translated page links to its English source and to the available equivalent translations. A notice marks translations whose source blob differs from the current English page. Translation generation stays in `scripts/i18n/translate.py`; the site build does not call a translation provider.
@@ -110,6 +111,5 @@ The SDK op tables (`sdk/python/loom/ops.py`, `sdk/typescript/src/generated/ops.t
make format # Prettier formats the Markdown, ruff its Python blocks
uv run pytest tests/unit/test_doc_links.py tests/unit/test_public_copy.py -q
python scripts/codegen/docs_reference.py --check
-pip install --require-hashes --no-deps --only-binary=:all: -r scripts/docs_site/requirements.txt # once, in a virtualenv
-mkdocs build --strict # the docs site build CI runs
+npm --prefix docs run build # builds the deployed documentation site
```
diff --git a/docs/development/repository-guide.md b/docs/development/repository-guide.md
index 680d8d038e..a0634450b7 100644
--- a/docs/development/repository-guide.md
+++ b/docs/development/repository-guide.md
@@ -21,7 +21,7 @@ What every top-level directory holds, where a concern lives inside `server/`, th
| `tests/` | `unit/`, `integration/`, `analyzer/`, `code_lanes/`, `fixtures/` (below) |
| `examples/` | runnable integration examples (`claude_agent_loop.py`, `ledger_run.py`, `log_conversation.py`, `onboarding_walkthrough.py`), and the course starter a teacher copies into a repository of their own (`course-starter/`, [teaching](../guides/teaching.md#hand-out-the-labs-as-an-assignment)) |
| `i18n/` | machine translations of the README, the quickstart and the use-case pages, one folder per language in `LANGUAGES`; generated by `scripts/i18n/translate.py` (`.github/workflows/i18n.yml`), never edited by hand |
-| `docs/` | this documentation; `mkdocs.yml` and `scripts/docs_site/` build it as the documentation site (`.github/workflows/docs-site.yml`) |
+| `docs/` | this documentation and the Blume configuration that publishes it at `https://loom.clickhouse.com/docs/` |
| `.github/` | CI, release and scan workflows (`workflows/`), issue and pull-request templates, and `social-preview.png`, the image uploaded in Settings → General → Social preview (GitHub reads only the uploaded copy) |
| `.devcontainer/` | the GitHub Codespaces try-out: a dev container that installs the latest release with the installer and connects Claude Code; not a development environment ([quickstart](../getting-started/quickstart.md#try-it-in-github-codespaces)) |
| `Dockerfile`, `Makefile`, `redeploy.sh`, `pyproject.toml`, `uv.lock` | the server's image, the task runner, the blue/green deploy script, the server package and its lock file |
diff --git a/docs/development/testing.md b/docs/development/testing.md
index 482952c6ba..5c2845e516 100644
--- a/docs/development/testing.md
+++ b/docs/development/testing.md
@@ -394,12 +394,9 @@ paths it leaves out, and why, are in the workflow's header.
weekly and on demand. It publishes the score the README badge shows and adds the findings
to code scanning; it does not run on pull requests and blocks no merge.
-`.github/workflows/docs-site.yml` builds the documentation site with `mkdocs build --strict`
-on pull requests into `main` that touch `docs/`, `mkdocs.yml`, `llms.txt`,
-`llms-install.md`, `scripts/docs_site/`, `scripts/codegen/page_summary.py` or the workflow
-itself, and on every push to `main`, so a broken link or anchor fails the
-`docs site / build` check. It publishes the site to GitHub Pages from `main` only while the
-repository variable `DOCS_SITE_ENABLED` is `true`.
+`npm --prefix docs run build` builds the documentation site from the
+`docs/` package. The deployment configuration publishes the result at
+`https://loom.clickhouse.com/docs/`.
Retarget a stacked pull request to `main` or a `release/X.Y` line before pushing its next
real change or required rebase. Editing the base alone does not trigger the default
diff --git a/docs/index.md b/docs/index.md
index 35ca029b0c..2f6a8c236e 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -95,5 +95,5 @@ Contributors can start with the [repository guide](development/repository-guide.
## Also
Find a definition in the [glossary](glossary.md) or a short answer in the [FAQ](faq.md).
-Agents can use the [documentation index](../llms.txt) or the
+Agents can use the [documentation index](https://loom.clickhouse.com/docs/llms.txt) or the
[combined Markdown](https://loom.clickhouse.com/docs/llms-full.txt).
diff --git a/mkdocs.yml b/mkdocs.yml
index 618dcc7945..a38620936d 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -1,6 +1,6 @@
-# The documentation site, built from docs/ by .github/workflows/docs-site.yml.
+# Legacy documentation configuration used by the translation parser.
site_name: ClickHouse Loom
-site_url: !ENV [LOOM_LEGACY_DOCS_URL, https://loom.clickhouse.com/docs/]
+site_url: https://loom.clickhouse.com/docs/
site_description: >-
Self-hosted MCP server that gives AI agents shared long-term memory, document search
with citations and a code index, stored in ClickHouse.
@@ -9,7 +9,6 @@ edit_uri: edit/main/docs/
docs_dir: docs
theme:
name: material
- custom_dir: scripts/docs_site/overrides
features: [navigation.sections, search.suggest, content.code.copy, content.action.edit]
markdown_extensions:
- admonition
@@ -21,9 +20,6 @@ markdown_extensions:
- name: mermaid
class: mermaid
format: !!python/name:pymdownx.superfences.fence_code_format
-hooks:
- - scripts/docs_site/locales.py
- - scripts/docs_site/hooks.py
validation:
links:
not_found: warn
diff --git a/scripts/docs_site/overrides/main.html b/scripts/docs_site/overrides/main.html
deleted file mode 100644
index 255e58f689..0000000000
--- a/scripts/docs_site/overrides/main.html
+++ /dev/null
@@ -1,32 +0,0 @@
-{% extends "base.html" %}
-{% block htmltitle %}
- {{ (loom_title if page else config.site_name) | e }}
-{% endblock %}
-{% block extrahead %}
- {% include "partials/locales-head.html" %}
- {% set desc = page.meta.description if page and page.meta and page.meta.description else config.site_description %}
-
-
-
-
-
-
-
- {% if page %}
-
- {% endif %}
- {% if page and page.file %}
- {# The page's Markdown copy, served beside it by hooks.py for agents that read Markdown. #}
-
- {% endif %}
- {% if page and page.is_homepage %}
- {# Search-console ownership proof for the GitHub Pages site; read on the home page only. #}
-
-
- {% endif %}
-{% endblock %}
-
-{% block content %}
- {% include "partials/locales-switch.html" %}
- {{ super() }}
-{% endblock %}
diff --git a/scripts/i18n/automation.py b/scripts/i18n/automation.py
index ca94336738..1026dd2646 100644
--- a/scripts/i18n/automation.py
+++ b/scripts/i18n/automation.py
@@ -410,33 +410,6 @@ def checks_succeeded(checks: list[dict[str, Any]]) -> bool:
)
-def sync_site(repository: str) -> None:
- """Retry a suppressed or failed deployment after a generated PR has merged."""
- owner = repository.split("/")[0]
- merged = api(
- f"repos/{repository}/pulls?state=closed&head={owner}:i18n/update&base=main&per_page=10"
- )
- merged = [item for item in merged if item.get("merged_at") and item.get("merge_commit_sha")]
- if not merged:
- return
- latest = max(merged, key=lambda item: item["merged_at"])
- merge_sha = latest["merge_commit_sha"]
- runs = api(f"repos/{repository}/actions/workflows/docs-site.yml/runs?branch=main&per_page=20")
- for run in runs["workflow_runs"]:
- if run["status"] == "completed" and run["conclusion"] != "success":
- continue
- if run["head_branch"] != "main" or not SHA.fullmatch(run["head_sha"]):
- continue
- ancestry = subprocess.run(
- ["git", "merge-base", "--is-ancestor", merge_sha, run["head_sha"]],
- cwd=t.ROOT,
- capture_output=True,
- )
- if ancestry.returncode == 0:
- return
- command("gh", "workflow", "run", "docs-site.yml", "--ref", "main")
-
-
def rollout_changes_allowed(base: str, candidate: str, codes: list[str]) -> bool:
"""Retain deferred data; new hidden copies may preserve an earlier pending batch."""
changed = git("diff", "--name-status", "--no-renames", "-z", base, candidate).split("\0")[:-1]
@@ -453,7 +426,6 @@ def rollout_changes_allowed(base: str, candidate: str, codes: list[str]) -> bool
def finalize() -> None:
"""Merge only an exact successful hosted CI head, with repository protections."""
repository = os.environ["GITHUB_REPOSITORY"]
- sync_site(repository)
owner = repository.split("/")[0]
prs = api(f"repos/{repository}/pulls?state=open&head={owner}:i18n/update&base=main&per_page=2")
if len(prs) != 1:
@@ -498,12 +470,11 @@ def finalize() -> None:
git("restore", "--source", sha, "--worktree", "--", "README.md", "i18n")
if t.check(skip_stale=True):
raise ValueError("translation validation failed before merge")
- command("mkdocs", "build", "--strict")
+ command("npm", "--prefix", "docs", "run", "build")
command("gh", "pr", "merge", str(pr["number"]), "--squash", "--match-head-commit", sha)
merged = api(f"repos/{repository}/pulls/{pr['number']}")
if not merged["merged"] or merged["head"]["sha"] != sha:
raise ValueError("translation merge readback does not match validated head")
- command("gh", "workflow", "run", "docs-site.yml", "--ref", "main")
def main(argv: list[str] | None = None) -> int:
diff --git a/tests/unit/test_i18n_automation.py b/tests/unit/test_i18n_automation.py
index 34de76eb8c..2df9cdc6d8 100644
--- a/tests/unit/test_i18n_automation.py
+++ b/tests/unit/test_i18n_automation.py
@@ -412,10 +412,10 @@ def api(path: str) -> Any:
actual = a.command
def command(*args: str, **kwargs: Any) -> str:
- if args[0] == "mkdocs":
+ if args[0] == "npm":
calls.append(args)
if site_raises:
- raise RuntimeError("strict site build failed")
+ raise RuntimeError("documentation build failed")
return ""
if args[0] != "gh":
return actual(*args, **kwargs)
@@ -433,17 +433,19 @@ def command(*args: str, **kwargs: Any) -> str:
monkeypatch.setattr(a, "command", command)
permitted = published_code in (approved.split() or list(a.t.ROLLOUT_LANGUAGES))
if merged and permitted and site_raises:
- with pytest.raises(RuntimeError, match="strict site build failed"):
+ with pytest.raises(RuntimeError, match="documentation build failed"):
a.finalize()
else:
a.finalize()
merge_calls = [call for call in calls if call[1:3] == ("pr", "merge")]
if merged and permitted and not site_raises:
assert len(merge_calls) == 1
- assert calls.index(("mkdocs", "build", "--strict")) < calls.index(merge_calls[0])
+ assert calls.index(("npm", "--prefix", "docs", "run", "build")) < calls.index(
+ merge_calls[0]
+ )
assert merge_calls[0][-2:] == ("--match-head-commit", sha)
assert "--admin" not in merge_calls[0] and "--auto" not in merge_calls[0]
- assert calls[-1] == ("gh", "workflow", "run", "docs-site.yml", "--ref", "main")
+ assert calls[-1] == merge_calls[0]
else:
assert merge_calls == []
assert not any(call[1:3] == ("workflow", "run") for call in calls)
@@ -475,51 +477,6 @@ def command(*args: str, **kwargs: Any) -> str:
assert calls[-1][-1] == f"expected_sha={previous}"
-@pytest.mark.parametrize(
- "site_result,expected_dispatch", [(None, True), ("failure", True), ("success", False)]
-)
-def test_scheduled_reconciliation_retries_suppressed_or_failed_site_deployment(
- repository: Path,
- monkeypatch: pytest.MonkeyPatch,
- site_result: str | None,
- expected_dispatch: bool,
-) -> None:
- sha = a.git("rev-parse", "HEAD")
- runs = (
- []
- if site_result is None
- else [
- {
- "head_branch": "main",
- "head_sha": sha,
- "status": "completed",
- "conclusion": site_result,
- }
- ]
- )
-
- def api(path: str) -> Any:
- if "/pulls?" in path:
- return [{"merged_at": "one", "merge_commit_sha": sha}]
- return {"workflow_runs": runs}
-
- monkeypatch.setattr(a, "api", api)
- actual = a.command
- calls: list[tuple[str, ...]] = []
-
- def command(*args: str, **kwargs: Any) -> str:
- if args[0] == "gh":
- calls.append(args)
- return ""
- return actual(*args, **kwargs)
-
- monkeypatch.setattr(a, "command", command)
- a.sync_site("ClickHouse/loom")
- assert bool(calls) is expected_dispatch
- if expected_dispatch:
- assert calls == [("gh", "workflow", "run", "docs-site.yml", "--ref", "main")]
-
-
@pytest.mark.parametrize(
"event,ref,expected,passed",
[
@@ -669,31 +626,6 @@ def command(*args: str, **kwargs: Any) -> str:
a.publish()
-def test_finalize_retries_merged_site_while_next_translation_pr_waits_for_ci(
- repository: Path, monkeypatch: pytest.MonkeyPatch
-) -> None:
- monkeypatch.setenv("GITHUB_REPOSITORY", "ClickHouse/loom")
- monkeypatch.setenv("GITHUB_EVENT_NAME", "schedule")
- sha = a.git("rev-parse", "HEAD")
- calls: list[tuple[str, ...]] = []
-
- def api(path: str) -> Any:
- if "/pulls?state=closed" in path:
- return [{"merged_at": "one", "merge_commit_sha": sha}]
- if "/pulls?state=open" in path:
- return [
- {"draft": False, "head": {"sha": sha, "repo": {"full_name": "ClickHouse/loom"}}}
- ]
- if "/actions/workflows/" in path:
- return {"workflow_runs": []}
- raise AssertionError(path)
-
- monkeypatch.setattr(a, "api", api)
- monkeypatch.setattr(a, "command", lambda *args: calls.append(args) or "")
- a.finalize()
- assert calls == [("gh", "workflow", "run", "docs-site.yml", "--ref", "main")]
-
-
def test_rollout_scope_preserves_generic_language_capability() -> None:
assert a.t.ROLLOUT_LANGUAGES == ("zh-CN", "ja", "ko", "pt-BR", "es")
assert {lang.code for lang in a.t.LANGUAGES} == {"zh-CN", "ja", "ko", "pt-BR", "es"}
From 767af90427a34664e4b79291fde238e796aa1a3b Mon Sep 17 00:00:00 2001
From: Shaun Struwig <41984034+Blargian@users.noreply.github.com>
Date: Tue, 24 Nov 2026 14:31:17 +0100
Subject: [PATCH 03/16] Restrict translation finalizer actions permission
The finalizer reads a validating CI run but no longer dispatches the retired documentation publisher.
Signed-off-by: Shaun Struwig <41984034+Blargian@users.noreply.github.com>
---
.github/workflows/i18n.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/i18n.yml b/.github/workflows/i18n.yml
index a48f8441f0..da645e912a 100644
--- a/.github/workflows/i18n.yml
+++ b/.github/workflows/i18n.yml
@@ -106,7 +106,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
- actions: write # Dispatch the docs deployment after merge.
+ actions: read # Read the validating CI run when finalizing translations.
contents: write # Write the validated squash merge to main.
pull-requests: write # Squash-merge the validated translation pull request.
steps:
From d463f27ef0c9413855949a2125e43f971de2c096 Mon Sep 17 00:00:00 2001
From: Shaun Struwig <41984034+Blargian@users.noreply.github.com>
Date: Tue, 24 Nov 2026 14:58:20 +0100
Subject: [PATCH 04/16] Generate LLM documentation indexes on the site
Signed-off-by: Shaun Struwig <41984034+Blargian@users.noreply.github.com>
---
.claude/rules/settings.md | 2 +-
docs/development/documentation-style.md | 28 +--
llms.txt | 219 ------------------------
scripts/codegen/docs_reference.py | 101 +----------
scripts/codegen/page_summary.py | 12 +-
tests/unit/test_docs_reference.py | 26 ---
6 files changed, 22 insertions(+), 366 deletions(-)
delete mode 100644 llms.txt
diff --git a/.claude/rules/settings.md b/.claude/rules/settings.md
index 56d5f53ca4..7d7fb14fbc 100644
--- a/.claude/rules/settings.md
+++ b/.claude/rules/settings.md
@@ -11,4 +11,4 @@ paths:
- `Annotated[T, LIVE]` makes a field take a runtime override (`server/settings/_live.py`): only for a field read at call time, never captured at boot or used as a calibration fallback (`test_live_settings.py`, which pins the LIVE set).
- A changed default is a `DefaultChange` in `server/settings/_history.py`, with the release and the reason (`test_settings_defaults.py`).
- Regenerate the reference, the settings-file schema and the settings-file template: `python -m scripts.codegen.settings_reference`, `python -m scripts.codegen.settings_schema` and `python -m scripts.codegen.settings_example` (`loom.example.yaml`).
-- The Helm chart, the operator guides, the compose files and `deploy/standalone/env.example` name settings by hand: a rename or removal changes every `git grep -nw -e LOOM_ -e ` hit that names this setting (the lowercase name is the settings file's key: the chart's `settingsFile`, CI). Leave generated output to its generator: `loom.example.yaml`, the generated pages and regions under `docs/reference/` (`configuration.md`, `operations/`, the `BEGIN GENERATED` regions) and the root `llms.txt` come from `settings_reference` and `docs_reference`, and the copies in `integrations/codex-plugin/` from `agent_plugin_sync`; rerun each one whose output names the setting.
+- The Helm chart, the operator guides, the compose files and `deploy/standalone/env.example` name settings by hand: a rename or removal changes every `git grep -nw -e LOOM_ -e ` hit that names this setting (the lowercase name is the settings file's key: the chart's `settingsFile`, CI). Leave generated output to its generator: `loom.example.yaml`, the generated pages and regions under `docs/reference/` (`configuration.md`, `operations/`, the `BEGIN GENERATED` regions) come from `settings_reference` and `docs_reference`, and the copies in `integrations/codex-plugin/` from `agent_plugin_sync`; rerun each one whose output names the setting.
diff --git a/docs/development/documentation-style.md b/docs/development/documentation-style.md
index daae8f39af..8bc7124b47 100644
--- a/docs/development/documentation-style.md
+++ b/docs/development/documentation-style.md
@@ -33,7 +33,7 @@ nothing is close enough. This page explains each leg, how the rank is computed,
which settings move it.
```
-`llms.txt` lists the first sentence of that paragraph for the page, and the documentation site uses it as the page's search description. Then, where they apply: the user-visible behaviour, the interfaces (operations, CLI, settings), how it works, limits and failure modes, and "Related" links. Architecture pages add **Source entry points** (paths and symbols) and **Invariants**.
+The documentation site uses the first sentence of that paragraph as the page's search description and generates `llms.txt` from it. Then, where they apply: the user-visible behaviour, the interfaces (operations, CLI, settings), how it works, limits and failure modes, and "Related" links. Architecture pages add **Source entry points** (paths and symbols) and **Invariants**.
## Prerequisites
@@ -82,19 +82,19 @@ Use these spellings everywhere; the [glossary](../glossary.md) defines them.
## Generated pages
-These pages are rendered from the code. Edit the source, then run the generator. `make lint` runs each with `--check`, so a stale page fails CI.
-
-| Page | Source | Generator |
-| ------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | ---------------------------------------------- |
-| [reference/configuration.md](../reference/configuration.md) | comments above fields in `server/settings/` | `python scripts/codegen/settings_reference.py` |
-| [reference/operations.md](../reference/operations.md) | `server.operations.registry.ALL_OPERATIONS` | `python scripts/codegen/docs_reference.py` |
-| [`llms.txt`](https://github.com/ClickHouse/loom/blob/main/llms.txt) (repository root) | every page's title and the first sentence of its opening paragraph | `python scripts/codegen/docs_reference.py` |
-| `reference/operations/.md` (one per group) | the op input/output models and the comments above their fields | `python scripts/codegen/docs_reference.py` |
-| [reference/workers.md](../reference/workers.md) | `server/workers/registry.py` (`_WORKERS`) | `python scripts/codegen/docs_reference.py` |
-| [reference/cli.md](../reference/cli.md) | the `loom` parser snapshot `tests/unit/snapshots/cli_tree.json` | `python scripts/codegen/docs_reference.py` |
-| [reference/errors.md](../reference/errors.md) | `server/core/errors.py` | `python scripts/codegen/docs_reference.py` |
-| [reference/status.md](../reference/status.md) | op `maturity` and the boolean settings of `server/settings/catalog.py` that load false | `python scripts/codegen/docs_reference.py` |
-| [reference/schema.md](../reference/schema.md) | `schemas/schema.sql` | `python scripts/codegen/docs_reference.py` |
+These pages are generated from the code or documentation source. Edit the source, then run the generator. `make lint` runs each with `--check`, so a stale page fails CI.
+
+| Page | Source | Generator |
+| ----------------------------------------------------------- | -------------------------------------------------------------------------------------- | ---------------------------------------------- |
+| [reference/configuration.md](../reference/configuration.md) | comments above fields in `server/settings/` | `python scripts/codegen/settings_reference.py` |
+| [reference/operations.md](../reference/operations.md) | `server.operations.registry.ALL_OPERATIONS` | `python scripts/codegen/docs_reference.py` |
+| `llms.txt` (documentation site) | the docs' page titles and opening paragraphs | Blume site build |
+| `reference/operations/.md` (one per group) | the op input/output models and the comments above their fields | `python scripts/codegen/docs_reference.py` |
+| [reference/workers.md](../reference/workers.md) | `server/workers/registry.py` (`_WORKERS`) | `python scripts/codegen/docs_reference.py` |
+| [reference/cli.md](../reference/cli.md) | the `loom` parser snapshot `tests/unit/snapshots/cli_tree.json` | `python scripts/codegen/docs_reference.py` |
+| [reference/errors.md](../reference/errors.md) | `server/core/errors.py` | `python scripts/codegen/docs_reference.py` |
+| [reference/status.md](../reference/status.md) | op `maturity` and the boolean settings of `server/settings/catalog.py` that load false | `python scripts/codegen/docs_reference.py` |
+| [reference/schema.md](../reference/schema.md) | `schemas/schema.sql` | `python scripts/codegen/docs_reference.py` |
On the documentation site, Blume serves each page's Markdown copy beside the page and
publishes `llms.txt`, `llms-full.txt`, and the repository's `llms-install.md`.
diff --git a/llms.txt b/llms.txt
deleted file mode 100644
index e38392469d..0000000000
--- a/llms.txt
+++ /dev/null
@@ -1,219 +0,0 @@
-# ClickHouse Loom
-
-> Loom is a self-hosted MCP server that gives AI agents shared long-term memory, document search with citations and a code index. It keeps its data in ClickHouse, with Postgres as an option for live memory and knowledge state, and serves it over MCP, HTTP and the Python and TypeScript SDKs.
-
-Start with [the docs map](docs/index.md). To install Loom, a coding agent reads [agent setup](docs/getting-started/agent-setup.md) and follows [agent-setup.txt](https://github.com/ClickHouse/loom/releases/latest/download/agent-setup.txt), which each release attaches with its pins filled in; for Cline or another MCP client, it follows [llms-install.md](llms-install.md). To connect to a running server: [connect a coding agent](docs/getting-started/connect-a-coding-agent.md). To decide whether Loom fits: [the overview](docs/getting-started/overview.md); for one need, [use cases](docs/use-cases/index.md). Every operation's fields are in [operations](docs/reference/operations.md) and the pages it links.
-
-## Getting started
-
-- [Overview](docs/getting-started/overview.md): Loom is a server that stores memory, documents, conversations, an entity graph and a code index for AI agents, as rows in ClickHouse, with Postgres as an option for live memory and knowledge state.
-- [Quickstart](docs/getting-started/quickstart.md): Run Loom locally with Docker.
-- [Set up Loom with your coding agent](docs/getting-started/agent-setup.md): This page is for a coding agent, Claude Code or Codex, asked to install Loom on the machine it runs on and to prove that the install works.
-- [Shared memory for Claude Code, Codex and Cursor](docs/getting-started/connect-a-coding-agent.md): Loom gives Claude Code, Codex and Cursor shared long-term memory through plugins or MCP tools connected to the same self-hosted server.
-- [Evaluate Loom](docs/getting-started/evaluate.md): Evaluate the decision you need to make, not every harness in the repository.
-- [Your first agent](docs/getting-started/first-agent.md): This tutorial builds a small agent with the Python SDK.
-- [Configure models and API keys](docs/getting-started/models-and-keys.md): Your coding agent, Loom's internal LLM and Loom's embedding model are separate choices.
-- [What's included](docs/getting-started/whats-included.md): This page lists Loom's main capabilities, self-hosted from the Apache-2.0 repository: one section per area, each row linked to the page that covers it.
-- [Install Loom as an MCP server](llms-install.md): This file is for a coding agent asked to set Loom up as an MCP server for its user.
-
-## Use cases
-
-- [Use cases](docs/use-cases/index.md): Each page answers one question people and agents ask when they look for a tool: what Loom does for that need and where to start.
-- [Memory for coding agents across sessions and tools](docs/use-cases/agent-memory.md): Loom is a self-hosted MCP memory server and HTTP API for coding agents that need to share project decisions, corrections and lessons across sessions and tools.
-- [Memory, recall, audit and erasure for autonomous agents](docs/use-cases/autonomous-agents.md): Loom provides self-hosted long-term memory for autonomous agents.
-- [Code intelligence for C++, Python, TypeScript, Go, Rust, Java and infrastructure code](docs/use-cases/code-intelligence-by-language.md): Loom's code index answers a coding agent's structure questions in the languages a repository holds: where a symbol is defined, who calls it, and what a change touches.
-- [A code index for coding agents](docs/use-cases/code-intelligence.md): Loom gives coding agents a shared index of your git repositories, served over MCP, so an agent asks a structure question and gets the lines that answer it instead of reading whole files.
-- [Lower model cost for coding agents](docs/use-cases/coding-agent-cost.md): With the Loom plugin and code index, Claude Code answered questions about the ClickHouse codebase at 6% to 21% lower model cost than without it on all three measured question sets.
-- [Document search and RAG for agents](docs/use-cases/document-search.md): Loom indexes your documents (Markdown and text, and PDF, `.docx` and `.pptx` files that its extractor service converts) and lets agents search them with citations over MCP, HTTP or the SDKs.
-- [Build a knowledge factory for AI agents](docs/use-cases/knowledge-factory.md): A knowledge factory turns source documents and lessons from agent work into knowledge that teams can review and reuse.
-- [Memory linked to code for coding agents](docs/use-cases/memory-linked-to-code.md): Loom links coding agents' memories to the functions, classes and files they name, follows them through refactors, and flags a memory when its code changes.
-- [Shared memory for a software factory and multi-agent workflows](docs/use-cases/multi-agent.md): Choose shared agent memory when implementation and review run in separate sessions or tools.
-- [Agent runs, traces and PR history](docs/use-cases/runs-and-pr-history.md): Loom records agent runs and conversations, checks bug drafts for duplicates and ranks candidate regression PRs without building the code.
-- [Self-hosted agent memory on ClickHouse](docs/use-cases/self-hosted-clickhouse.md): Loom runs on your own infrastructure, with Docker or on Kubernetes with its Helm chart, and stores agent memory, documents, conversations and code indexes as tables in ClickHouse.
-
-## FAQ and glossary
-
-- [Frequently asked questions](docs/faq.md): Short answers to the first questions people ask.
-- [Glossary](docs/glossary.md): Loom's terms, alphabetically, each defined once.
-
-## Concepts
-
-- [Identities and namespaces](docs/concepts/identities-and-namespaces.md): Loom answers two questions on every call: whose row is this (the identity tuple, plus two columns the server stamps), and may this caller touch it (the token, the namespace's grants and its classification).
-- [Agentic memory](docs/concepts/memory.md): Agentic memory lets an AI agent store, retrieve and revise information as it works.
-- [Retrieval and ranking](docs/concepts/retrieval-and-ranking.md): This page explains how `memory.search` finds rows.
-
-## Features
-
-- [Features](docs/features/index.md): Loom gives agents memory, source material, and records of prior work in a namespace they can access.
-- [Conversations and sessions](docs/features/conversations-and-sessions.md): Loom keeps three kinds of session state, each in its own plane:
-- [The dashboard](docs/features/dashboard.md): The dashboard is a React single-page app the Loom server serves at its root URL.
-- [Entity graph](docs/features/entity-graph.md): Loom keeps an entity graph beside the memory rows, in the same ClickHouse database.
-- [Knowledge documents](docs/features/knowledge.md): A knowledge document is text an agent looks things up in: a runbook, a specification, a README.
-- [Namespaces and sharing](docs/features/namespaces-and-sharing.md): A namespace is the unit of isolation and sharing inside an org.
-- [Runs](docs/features/runs.md): A run is one execution of a task, such as "triage issue 1234".
-- [Tasks, decisions and policies](docs/features/tasks-and-decisions.md): Three planes sit beside memory for coordination between agents.
-- [Unified search and context packs](docs/features/unified-search.md): `loom_search` searches memory, profile, knowledge, past conversations and readable issues and PRs across the caller's namespaces in one round trip.
-- [Code index for coding agents over MCP](docs/features/code-index/overview.md): With code workers enabled for a repository, Loom indexes it into ClickHouse and answers structure questions through the `code.*` operations: where a symbol is defined, who calls it, what a change reaches, which merged PR touched a line.
-- [Code index freshness](docs/features/code-index/freshness.md): The index trails the repository: it indexes merged commits on a configured branch, pass by pass, and each tier advances its own watermark.
-- [History, PRs and releases](docs/features/code-index/history-and-prs.md): ClickHouse Loom's PR-history operations need merged-PR history.
-- [Code operations](docs/features/code-index/operations.md): This page maps questions to `code.*` ops.
-- [Adding repositories](docs/features/code-index/repositories.md): A fresh install indexes no repository.
-- [Integrations](docs/features/integrations/index.md): Integrations put Loom's tools in front of a model, capture its conversations, or receive its telemetry.
-- [Agent instructions](docs/features/integrations/agent-instructions.md): A short block in an agent's instruction file tells it when to load Loom's context, save a fact and use the code index instead of grepping or reading files.
-- [Agent Substrate](docs/features/integrations/agent-substrate.md): Needs Agent Substrate v1.0.0 and Loom's Helm chart in one Kubernetes cluster: Substrate's egress gateway adds each agent's Loom token to its MCP calls.
-- [Claude Code plugin](docs/features/integrations/claude-code.md): The `loom` plugin for Claude Code does three things in one install:
-- [ClickStack and HyperDX](docs/features/integrations/clickstack.md): Loom always emits OpenTelemetry; the HyperDX sources, dashboards and the erasure step need configuring.
-- [Codex plugin](docs/features/integrations/codex.md): The Codex plugin gives Codex the same Loom integration as Claude Code: MCP tools, hooks that capture the session and load a primer, and the code shunt.
-- [Cursor](docs/features/integrations/cursor.md): Connect Cursor to Loom to save decisions and reuse lessons from earlier sessions.
-- [Agent frameworks and orchestrators](docs/features/integrations/frameworks.md): The SDKs ship adapters that present Loom through a framework's own memory or retrieval interface.
-- [The grep shim](docs/features/integrations/grep-shim.md): The grep shim is a `grep`/`rg` wrapper that appends each hit's enclosing function, from the code index, to the match line; it needs Node 18 or later, a viewer token and a repository in the code index.
-- [Langfuse](docs/features/integrations/langfuse.md): Needs `LOOM_LANGFUSE_URL` and `LOOM_LANGFUSE_ADMIN_TOKEN`; nothing is sent until both are set.
-- [Connect to Loom's MCP memory server](docs/features/integrations/mcp-clients.md): An MCP memory server lets AI agents save and retrieve durable facts through the Model Context Protocol.
-- [OKF bundles](docs/features/integrations/okf.md): A namespace can be rendered as an OKF (Open Knowledge Format) v0.2 bundle: one Markdown file per memory with YAML frontmatter, an `index.md` per directory listing each concept with a one-line description, and a `log.md` of changes.
-- [VS Code](docs/features/integrations/vscode.md): GitHub Copilot in VS Code can save and retrieve project decisions through Loom's MCP server over streamable HTTP.
-- [Conflicts and refusal](docs/features/memory/conflicts-and-refusal.md): Every memory write is judged against the facts the namespace already holds.
-- [Extraction from transcripts](docs/features/memory/extraction.md): `memory.set_from_messages` takes a transcript and the server decides what in it is durable.
-- [History and provenance](docs/features/memory/history-and-provenance.md): Every write to memory makes a new version; nothing is edited in place.
-- [Procedures and learnings](docs/features/memory/procedures-and-learnings.md): Procedural memory gives AI agents reusable steps for recurring tasks and evidence from earlier runs.
-- [Retention and erasure](docs/features/memory/retention-and-erasure.md): Loom deletes no memory unless its writer, the namespace owner or the operator asks.
-- [Search and ask](docs/features/memory/search-and-ask.md): `memory.search` returns ranked hits for the agent to read.
-- [Working memory and profiles](docs/features/memory/working-memory-and-profiles.md): Two planes hold text an agent is given every time instead of finding it by search:
-- [Writing memory](docs/features/memory/writing.md): A memory is one claim stored under a key in a namespace.
-- [Audit log](docs/features/observability/audit.md): Audit rows, the `audit_verifier` worker and the checkpoint chain are on by default.
-- [Cost and usage](docs/features/observability/cost-and-usage.md): Loom records every upstream dollar it spends on embedding and LLM calls against the operation that spent it, in the per-operation ledger `loom.agent_events`.
-- [Telemetry](docs/features/observability/telemetry.md): Loom reports on itself in three layers:
-- [Issue duplicate checks and regression candidates for agents](docs/features/tracker/overview.md): With `LOOM_TRACKER_ORG` set and a registered source, Loom lets agents check whether a bug is already reported and rank changes that may have introduced a regression, using tracker records and indexed PR history.
-- [Maintain a GitHub tracker record](docs/features/tracker/github-feed.md): `loom tracker-feed` copies repository issues, pull requests, issue comments and inline review comments into a team's dedicated ClickHouse database.
-- [Tracker record contract](docs/features/tracker/record-contract.md): The `tracker.*` ops, and the tracker legs of `code.*` and `loom_search`, read a team's issues, pull requests and incidents live from the team's own ClickHouse with a read-only credential.
-
-## Guides
-
-- [Guides](docs/guides/index.md): Choose a task to connect an agent, put shared context to work, or evaluate a workflow.
-- [Integrate Loom into an agent](docs/guides/agent-integration.md): This guide covers what an agent sends to Loom and how it reads the answers: the client surface, the identity, what to write, and how to read.
-- [Choose retrieval scope from the audience](docs/guides/audience-scoped-retrieval.md): Needs an end-user issuer (`LOOM_JWT_END_USER_ISSUERS_JSON`): an agent host signs each request as the person who asked, and picks the collections a reply may draw on from who will read it.
-- [Code tools for model integrations](docs/guides/code-tools.md): An indexed code namespace and a token with read access let an SDK tool loop investigate definitions, behavior and relationships with `loom_code_lookup`.
-- [Compare self-hosted memory tools for coding agents](docs/guides/compare-coding-agent-memory.md): Choose memory by what the next coding session needs.
-- [Debug a request](docs/guides/debugging.md): Loom tags everything one request does with the same id, so tracing a request is a join.
-- [Customize the extraction pipeline](docs/guides/extraction-pipeline.md): `memory.set_from_messages` runs its transcript through an ordered list of steps that share one state.
-- [Headless bots](docs/guides/headless-bots.md): A headless bot runs with no person to paste a token, notice a silent failure or say "remember this".
-- [Import ClickGap memory](docs/guides/importing-clickgap-memory.md): `loom import-clickgap` loads one SQLite export shape, a ClickGap `lessons` store, into a Loom namespace; skip this page unless you have such an export.
-- [Store an investigation agent's memory](docs/guides/investigation-agent-memory.md): An investigation agent produces several kinds of state, and Loom has a plane for each.
-- [Optimize a namespace from its audit](docs/guides/optimize-namespace.md): A writer that uses `memory.set` as an object store (JSON blobs under hash keys, leases as memories, documents as claims) leaves every table consistent and recall useless.
-- [Tune Loom's performance](docs/guides/performance-tuning.md): Every lever on this page is a setting or a request field.
-- [Query Loom from Postgres](docs/guides/query-from-postgres.md): This guide reads a tenant's memories, conversations and usage from the org's own Postgres, where they can be joined with the application's tables.
-- [Answer repository questions without a local checkout](docs/guides/repository-questions.md): An AI agent can answer questions about a Git repository without cloning it onto the machine that runs the agent.
-- [How to choose AI software factory tools](docs/guides/software-factory-tools.md): An AI software factory coordinates agents and existing development tools to take work from an issue to a tested change.
-- [Teaching with Loom](docs/guides/teaching.md): Loom can serve as the lab environment for a course on AI agents, information retrieval, databases or software engineering.
-- [Tokens and grants](docs/guides/tokens-and-grants.md): Every call carries one JWT.
-- [Trace and resume long agent runs](docs/guides/trace-and-resume.md): A long run (process 300 files, crawl a repository, work through a plan) can stop part way: a crash, a full context window, a deploy, a pause.
-- [Use Loom without the dashboard](docs/guides/without-the-dashboard.md): Everything the `/me` dashboard does can be done from a terminal, a script or an agent's shell.
-
-## Operations
-
-- [Operations](docs/operations/index.md): Deploy Loom for a team, choose storage and identity settings, and maintain a running instance.
-- [Exporting usage to a data warehouse](docs/operations/analytics-export.md): `loom export-analytics` writes one UTC day of usage and a snapshot of the namespaces to an S3 bucket as Parquet files, one file per entity per day, for a data warehouse to load.
-- [Native assistant setup](docs/operations/assistant.md): The assistant runs inside Loom and uses the same dashboard, HTTP, MCP and SDK interfaces.
-- [Backup and recovery](docs/operations/backup-and-recovery.md): A Loom backup is a ClickHouse backup, plus the document bucket while any catalog row names an object in it, and under the Postgres authority a backup of Postgres too.
-- [Attaching the first cell](docs/operations/cell-attach.md): `loom cell attach` turns a prepared first cell (`loom cell prepare`, mode `recording`, directory row `attaching`) into a `serving` one: it places every org the cell holds in the router's directory, raises the cell's mode to `enforced` and…
-- [Cell control upgrades and recovery](docs/operations/cell-control.md): Cell control mutations require generation-aware clients and router handlers, and direct access to the cell's Postgres.
-- [Update a cell's configuration or addresses](docs/operations/cell-update.md): `loom cell update` reserves a configuration before the cell accepts it.
-- [ClickHouse Cloud and Managed Postgres](docs/operations/clickhouse-cloud.md): This guide runs Loom on Kubernetes over two managed services: ClickHouse Cloud for projections, vectors, history and analytics, and ClickHouse Managed Postgres as the memory authority.
-- [Code index operations](docs/operations/code-index-operations.md): This page covers how to enable the code index workers, configure repositories and keep the index current; the code index runs only when an operator enables its workers and configures repositories.
-- [Deployment](docs/operations/deployment.md): Loom is one server image plus ClickHouse (and Postgres, under `LOOM_STORAGE_AUTHORITY=postgres`), with the document extractor service as an image of its own (container images).
-- [Kubernetes](docs/operations/kubernetes.md): `deploy/helm/loom` runs Loom as N identical replicas on Kubernetes: one Deployment of web pods over one ClickHouse service, each pod a full replica.
-- [Maintenance](docs/operations/maintenance.md): Every command here is a `loom` subcommand; run it inside the container that has the deployment's environment (`docker exec loom-server loom …`, or `loom-workers` in a split deployment).
-- [Monitoring](docs/operations/monitoring.md): This page says what to watch.
-- [Copying a namespace to another Loom](docs/operations/okf-sync.md): A job inside the private network copies one namespace from a private Loom to a public one on a schedule: `loom export-okf` reads it from the private Loom, and `loom import-okf --prune` writes it to the public Loom.
-- [Postgres memory authority](docs/operations/postgres.md): This guide sets up a Loom deployment whose live memory and knowledge document heads are held in Postgres, on ClickHouse Managed Postgres or on a self-hosted Postgres, and covers what to check before it serves.
-- [Running N replicas](docs/operations/replicas.md): Every Loom process is a full replica.
-- [Runtime settings](docs/operations/runtime-settings.md): Every setting is an environment variable `LOOM_` read at startup, and can also go in the YAML settings file (configuration reference).
-- [Single sign-on (OIDC)](docs/operations/sso.md): Loom can hand the human sign-in to an OpenID Connect identity provider.
-- [Supported versions](docs/operations/supported-versions.md): Releases N and N−1 get fixes, and an SDK at `X.Y` works with a server at `X.Y` or `X.(Y−1)`.
-- [Troubleshooting](docs/operations/troubleshooting.md): Each entry gives a symptom, the check that confirms its cause, and the fix.
-- [Upgrades](docs/operations/upgrades.md): An upgrade replaces the image (and the document extractor's, which holds no state) and applies the migrations the new build carries.
-
-## Reference
-
-- [Reference](docs/reference/index.md): Look up SDKs, request and response fields, CLI commands, and server settings.
-- [CLI reference](docs/reference/cli.md): `loom` is the one command-line entry point for running, maintaining and connecting to a Loom deployment.
-- [Configuration reference](docs/reference/configuration.md): Every setting is declared in one file, `server/settings/catalog.py`, and is an environment variable `LOOM_` read at startup into `server.settings.settings`.
-- [Environment variables reference](docs/reference/environment.md): Almost everything Loom is configured with is a settings field: the environment variable `LOOM_` of a field on `server.settings.Settings`, listed with its default and meaning in the generated configuration reference.
-- [Errors reference](docs/reference/errors.md): Every refusal Loom makes carries a stable, upper-case `code`.
-- [Extractor contract](docs/reference/extractor-contract.md): An extractor is an HTTP service the Loom server sends an original file to and gets its extraction artifact back from.
-- [Go SDK for AI agent memory](docs/reference/go-sdk.md): The Go SDK stores and retrieves agent memory from a running Loom server over HTTP.
-- [HTTP API reference](docs/reference/http-api.md): Every Loom operation is one HTTP endpoint, `POST /v1/`, generated from the operation registry in `server/operations/` (`server/transport/http.py`, `build_router`).
-- [MCP reference](docs/reference/mcp.md): Loom serves its operations as MCP tools at `/mcp`.
-- [Operations reference](docs/reference/operations.md): An operation (op) is one named unit of work on the Loom wire, such as `memory.set` or `code.search`.
-- [Python SDK reference](docs/reference/python-sdk.md): The Python SDK (`clickhouse-loom`, source in `sdk/python/loom/`) is an async client over the HTTP API.
-- [Rust SDK](docs/reference/rust-sdk.md): The `clickhouse-loom` crate provides typed async and blocking calls for every registered Loom operation.
-- [Schema reference](docs/reference/schema.md): Loom keeps its ClickHouse state in the `loom` and `loom_telemetry` databases.
-- [SQL surface](docs/reference/sql-surface.md): The SQL surface is a set of read-only ClickHouse views over a tenant's memories, memory history, conversations and request ledger.
-- [Status of Loom's surfaces](docs/reference/status.md): This page counts each op group's stable ops, names its experimental ones, and lists every boolean setting that loads false, so a caller can tell, before relying on an op or a switch, whether it is stable and whether it is on by default.
-- [TypeScript SDK reference](docs/reference/typescript-sdk.md): The TypeScript SDK (`@clickhouse/loom`, source in `sdk/typescript/src/`) is a typed client over the HTTP API.
-- [Workers reference](docs/reference/workers.md): A worker is a supervised background loop: one pass function run on an interval by the worker supervisor.
-
-## Architecture
-
-- [Microsoft Agent Framework context provider](docs/architecture/agent-framework-adapter.md): `LoomContextProvider` implements the framework's context-provider interface over the asynchronous Python SDK.
-- [Agno user-memory database](docs/architecture/agno-adapter.md): The Agno adapter implements the user-memory methods of its 3.2 `BaseDb` interface through the synchronous Loom SDK.
-- [Assistant design](docs/architecture/assistant.md): Loom's native assistant answers namespace questions through bounded model turns and read-only operations, under the caller's identity.
-- [Cells](docs/architecture/cells.md): A deployment's memory can outgrow one Postgres primary and one ClickHouse service, and an org may want its memory in services of its own.
-- [Claude API memory file tree](docs/architecture/claude-memory-adapter.md): The Claude API memory adapter implements the framework's Python memory-tool bases and TypeScript memory handlers through Loom knowledge documents.
-- [ClickHouse](docs/architecture/clickhouse.md): Durable Loom state lives in ClickHouse, except document bytes in an optional S3-compatible bucket and, under the Postgres memory authority, the Postgres tables: live memory, knowledge state and the records beside them.
-- [Code index architecture](docs/architecture/code-index-architecture.md): This page is the inside view of the code index: how files become chunks, symbols and edges, and how the two tiers stay current.
-- [Cost budgets](docs/architecture/cost-budgets.md): Namespace and named-user caps use the rolling 24-hour cost ledger in `agent_events`.
-- [Definition drafts](docs/architecture/definition-drafts.md): Needs `knowledge_gaps_enabled` for gap drafts or `knowledge_query_history_enabled` for query history.
-- [Dify tools adapter](docs/architecture/dify-adapter.md): The Dify plugin calls Loom through the Python SDK and stores no content locally.
-- [Document extraction](docs/architecture/document-extraction.md): An uploaded original is parsed into one shape, the extraction artifact, by an extractor service: a separate process with its own dependencies, never the Loom server.
-- [Document sources](docs/architecture/document-sources.md): A document source pulls files from a document store (a shared-folder store, a page store, a project tracker, a meeting store) into a namespace's documents and keeps them in step, on any shared namespace or collection.
-- [Documentation translation requests](docs/architecture/documentation-translation.md): The translation generator splits prepared English text into bounded requests, then checks the assembled translation before writing it.
-- [Failure and recovery](docs/architecture/failure-and-recovery.md): The primary write and every access decision fail closed.
-- [GitHub tracker feed](docs/architecture/github-feed.md): The GitHub feed maintains a team's tracker record in the team's ClickHouse database.
-- [Google ADK memory service](docs/architecture/google-adk-adapter.md): The Google ADK adapter implements the framework's memory service through Loom's Python and TypeScript SDKs.
-- [Haystack document store and retriever](docs/architecture/haystack-adapter.md): The optional Haystack 3.5 adapter implements its document-store protocol and a native retrieval component through the synchronous Loom SDK.
-- [Knowledge gaps](docs/architecture/knowledge-gaps.md): Loom records the searches that found nothing a caller could use and groups them, once a day, into knowledge gaps: the questions several people asked that the namespace's memory and documents do not answer.
-- [Live connected-source search](docs/architecture/live-source-search.md): `search.query(live=true)` adds an ephemeral section from the asker's own connected Drive and Notion registrations.
-- [LLM and embedding architecture](docs/architecture/llm-architecture.md): Loom uses pluggable embedders and model clients configured through server settings.
-- [Memory architecture](docs/architecture/memory-architecture.md): The memory plane stores facts in `loom.memory`, makes them searchable through `loom.memory_embeddings`, and derives evidence, chunks, graph rows and statistics from them.
-- [Memory consent and derived text](docs/architecture/memory-consent.md): A deletion contracts memory and records content refusal before its tombstone commits.
-- [n8n adapter](docs/architecture/n8n-adapter.md): The n8n community package stores conversation history and durable facts in a Loom deployment through the TypeScript SDK.
-- [OpenAI Agents conversation sessions](docs/architecture/openai-agents-sessions.md): `LoomSession` implements the native Python and TypeScript session interfaces over Loom episodic memories.
-- [Pipecat demonstration recording](docs/architecture/pipecat-demo-recording.md): The optional `pipecat-demo.yml` workflow renders a timestamped execution visualization of an authenticated native Pipecat text-memory check.
-- [Provider reconfiguration](docs/architecture/provider-reconfiguration.md): Loom stores dashboard model configuration as encrypted, versioned rows in `loom.provider_configuration`.
-- [Rolling upgrades: builds N-1 and N side by side](docs/architecture/rolling-upgrades.md): Every Loom process is a full replica behind one URL, and an upgrade replaces them one at a time.
-- [Security](docs/architecture/security.md): Loom separates tenants by columns: every row carries the identity tuple, and every read filters on it.
-- [Server layout](docs/architecture/server-layout.md): `server/` is organised by domain.
-- [Sharing knowledge](docs/architecture/sharing.md): A collection is a namespace that only grants open.
-- [Document source push notifications](docs/architecture/source-push.md): Needs `LOOM_KNOWLEDGE_SOURCE_PUSH_ENABLED=true` to request document source syncs from provider notifications.
-- [Storage authority: Postgres for live memory, ClickHouse for search](docs/architecture/storage-authority.md): Loom runs with one of two memory authorities, chosen per deployment by `LOOM_STORAGE_AUTHORITY`.
-- [Storage layout: which store holds each table, and why](docs/architecture/storage-layout.md): Each Loom table belongs in Postgres or ClickHouse by how it is read and written; this page places every table, with the wave that moves it.
-- [System overview](docs/architecture/system-overview.md): Loom is a Python server (a FastAPI application plus a supervisor of background workers) and ClickHouse, with Postgres as an option for live memory and knowledge state.
-
-## Benchmarks
-
-- [Benchmarks overview](docs/benchmarks/overview.md): Ranking levers, similarity gates, cache thresholds and extraction prompts change behaviour that a unit test cannot judge.
-- [Adding a benchmark case, dataset or suite](docs/benchmarks/adding-a-case.md): The committed sets are small (set sizes), so a new case is the cheapest way to improve the suite.
-- [Benchmark coverage](docs/benchmarks/coverage.md): This matrix shows which parts of Loom's memory, knowledge and code flows have a reproducible public measurement.
-- [Benchmark methodology](docs/benchmarks/methodology.md): This page covers what the harnesses compute, how a delta is judged against noise, when two numbers compare, and where the numbers are biased.
-- [Benchmark results](docs/benchmarks/results.md): This page lists only numbers that a committed file reproduces.
-- [Running the benchmarks](docs/benchmarks/running.md): Run every command from the repository root with the checkout's interpreter and the root first on `PYTHONPATH`:
-- [SDK issue resolution](docs/benchmarks/sdk-issue-resolution.md): The SDK issue harness measures proposed patches with and without Loom code lookup.
-- [Skill eval](docs/benchmarks/skill-eval.md): The skill eval grades the `loom-memory` skill by the namespace an agent leaves behind.
-- [Proposed software factory pilot](docs/benchmarks/software-factory-pilot.md): This draft measures whether application-owned context retrieval changes objective resolution, total calls, tokens, cost per successful resolution and elapsed time.
-
-## Optional
-
-- [Add a ClickHouse table or column](docs/development/adding-a-table.md): Loom's ClickHouse state is tables in the `loom` and `loom_telemetry` databases; under the Postgres memory authority, live memory, knowledge state and the records beside them are in Postgres.
-- [Add a background worker](docs/development/adding-a-worker.md): A worker is a row in `server/workers/registry.py` (`_WORKERS`) plus a module with one pass function.
-- [Add an operation](docs/development/adding-an-operation.md): An operation is declared once, in the registry.
-- [Add language support to the code index](docs/development/adding-language-support.md): The code index reads a repository in two tiers:
-- [Code generation](docs/development/code-generation.md): Several files in the repository are derived from the code: the SDKs' operation tables and wire types, the reference pages, the Codex plugin's copies, the op reach manifest, the schema dump.
-- [Curation loop design](docs/development/curation-loop-design.md): This page is the design of the curation loop, which turns what people ask into definitions an organization stands behind.
-- [Dashboard design](docs/development/dashboard-design.md): The dashboard at `/` is built on ClickHouse's design system, Click UI, in its dark theme.
-- [Documentation style guide](docs/development/documentation-style.md): How to place a new page in the right section, write it in the house style, and pass the documentation checks on the first push.
-- [Extend Loom](docs/development/extending-loom.md): Loom has one registry per kind of thing: operations, workers, settings, providers, language lanes, extraction steps and tracker sources.
-- [Local development](docs/development/local-development.md): This page sets up a checkout for working on Loom's code.
-- [Migrations](docs/development/migrations.md): This page holds the rules for writing a migration.
-- [Release process](docs/development/release-process.md): Loom follows SemVer: the server, both SDKs, the web app, the root skills (`loom-code`, `loom`), the Cursor plugin and the Agent Plugins package that ship them, and the Gemini CLI extension share one version `X.Y.Z`.
-- [Repository guide](docs/development/repository-guide.md): What every top-level directory holds, where a concern lives inside `server/`, the order to read the code in, and the conventions a pull request fails without.
-- [Testing](docs/development/testing.md): Which suite a test belongs in, what each suite needs to run, how tests skip when their environment is missing, which gates CI enforces, and how to regenerate what they pin.
diff --git a/scripts/codegen/docs_reference.py b/scripts/codegen/docs_reference.py
index 09233e504e..82829cdc0c 100644
--- a/scripts/codegen/docs_reference.py
+++ b/scripts/codegen/docs_reference.py
@@ -19,8 +19,7 @@
- `status_ops`, `status_switches`: each op group's stable and experimental ops (op
`maturity`), and every boolean setting in `server/settings/catalog.py` that loads false
-It also writes `llms.txt` at the repository root (every doc page with its outcome line, for
-agents), and one fully generated page per op group, `docs/reference/operations/.md`,
+It also writes one fully generated page per op group, `docs/reference/operations/.md`,
with every op's input and output fields (type, default, and the comment written above the
field in its model).
@@ -47,12 +46,7 @@
sys.path.insert(0, str(ROOT))
from scripts.codegen.common import write_atomic # noqa: E402
-from scripts.codegen.page_summary import ( # noqa: E402
- SECTIONS,
- first_sentence,
- page_key,
- page_summary,
-)
+from scripts.codegen.page_summary import first_sentence # noqa: E402
from scripts.codegen.sdk_py_admin_gen import render_admin_routes_table # noqa: E402
from server.core.errors import ( # noqa: E402
CLASS_BY_CODE,
@@ -391,83 +385,6 @@ def render_group_pages() -> dict[str, str]:
return {f"{g}.md": render_group(g, ops) for g, ops in _op_groups().items()}
-# --- llms.txt -----------------------------------------------------------------
-
-LLMS_TXT = ROOT / "llms.txt"
-_AGENT_SETUP_TXT = "https://github.com/ClickHouse/loom/releases/latest/download/agent-setup.txt"
-
-
-# llms.txt's sections in order: what Loom is for and how to use it first ("faq" is the FAQ and
-# glossary block), then operations and reference; Development is last, as the Optional section
-# the llms.txt format lets a reader skip.
-_LLMS_ORDER = (
- "getting-started",
- "use-cases",
- "faq",
- "concepts",
- "features",
- "guides",
- "operations",
- "reference",
- "architecture",
- "benchmarks",
- "development",
-)
-
-
-def render_llms_txt() -> str:
- """The llms.txt index agents read: every doc page, grouped, with its outcome line."""
- docs = ROOT / "docs"
- out = [
- "# ClickHouse Loom",
- "",
- "> Loom is a self-hosted MCP server that gives AI agents shared long-term memory, "
- "document search with citations and a code index. It keeps its data in ClickHouse, "
- "with Postgres as an option for live memory and knowledge state, and serves it over "
- "MCP, HTTP and the Python and TypeScript SDKs.",
- "",
- "Start with [the docs map](docs/index.md). To install Loom, a coding agent reads "
- "[agent setup](docs/getting-started/agent-setup.md) and follows "
- f"[agent-setup.txt]({_AGENT_SETUP_TXT}), "
- "which each release attaches with its pins filled in; for Cline or another MCP "
- "client, it follows [llms-install.md](llms-install.md). To connect to a running "
- "server: [connect a coding agent](docs/getting-started/connect-a-coding-agent.md). "
- "To decide whether Loom fits: [the overview](docs/getting-started/overview.md); for "
- "one need, [use cases](docs/use-cases/index.md). Every operation's fields are in "
- "[operations](docs/reference/operations.md) and the pages it links.",
- "",
- ]
-
- def entry(path: Path) -> str:
- title, outcome = page_summary(path)
- rel = path.relative_to(ROOT).as_posix()
- return f"- [{title}]({rel})" + (f": {outcome}" if outcome else "")
-
- titles = {sub: heading for heading, sub in SECTIONS}
- if sorted(_LLMS_ORDER) != sorted([*titles, "faq"]):
- raise ValueError("_LLMS_ORDER must name every section in SECTIONS once")
- for sub in _LLMS_ORDER:
- if sub == "faq":
- out.append("## FAQ and glossary\n")
- out += [entry(docs / "faq.md"), entry(docs / "glossary.md"), ""]
- continue
- # In the sidebar's order (page_key); the per-group operation pages are reached through
- # docs/reference/operations.md.
- pages = sorted(
- (p for p in (docs / sub).rglob("*.md") if p.parent != GROUP_DIR),
- key=lambda p: page_key(p.relative_to(docs).as_posix()),
- )
- if not pages:
- continue
- out.append(f"## {'Optional' if sub == 'development' else titles[sub]}\n")
- out += [entry(p) for p in pages]
- if sub == "getting-started":
- # The other install route, for clients without a Loom plugin, closes the section.
- out.append(entry(ROOT / "llms-install.md"))
- out.append("")
- return "\n".join(out).rstrip("\n") + "\n"
-
-
# --- workers ------------------------------------------------------------------
@@ -780,23 +697,9 @@ def main(argv: list[str] | None = None) -> int:
else:
print(f"{rel} is current")
stale |= _sync_group_pages(check=args.check)
- stale |= _sync_file(LLMS_TXT, render_llms_txt(), check=args.check)
return stale
-def _sync_file(path: Path, text: str, *, check: bool) -> int:
- rel = path.relative_to(ROOT).as_posix()
- current = path.read_text(encoding="utf-8") if path.exists() else None
- if check:
- if current != text:
- print(f"{rel} is stale: run {COMMAND}", file=sys.stderr)
- return 1
- return 0
- if write_atomic(path, text.encode("utf-8")):
- print(f"wrote {rel}")
- return 0
-
-
def _sync_group_pages(*, check: bool) -> int:
pages = render_group_pages()
stale = 0
diff --git a/scripts/codegen/page_summary.py b/scripts/codegen/page_summary.py
index 2732b59dfb..d3b7f3bfb1 100644
--- a/scripts/codegen/page_summary.py
+++ b/scripts/codegen/page_summary.py
@@ -1,9 +1,8 @@
"""A documentation page's title and the first sentence of its opening paragraph.
-`llms.txt` (scripts/codegen/docs_reference.py) lists this sentence for every page, and the
-documentation site (scripts/docs_site/hooks.py) uses it as the page's meta description,
-cut to the length a search engine shows, so both start with the same answer. Standard
-library only: the site build imports it without the server's dependencies.
+The documentation site uses this sentence as the page's meta description, cut to the
+length a search engine shows. Standard library only: the site build imports it without the
+server's dependencies.
"""
from __future__ import annotations
@@ -11,8 +10,7 @@
import re
from pathlib import Path
-# The docs sections, as (title, folder under docs/), in the documentation site's sidebar
-# order; llms.txt picks its own lead order from them (scripts/codegen/docs_reference.py).
+# The docs sections, as (title, folder under docs/), in the documentation site's sidebar order.
SECTIONS = (
("Getting started", "getting-started"),
("Use cases", "use-cases"),
@@ -27,7 +25,7 @@
)
# The pages that open their section right after its index page (Getting started's is its
-# overview.md): llms.txt and the documentation site's sidebar list them in this order.
+# overview.md): the documentation site's sidebar lists them in this order.
LEAD_PAGES = ("getting-started/quickstart.md",)
diff --git a/tests/unit/test_docs_reference.py b/tests/unit/test_docs_reference.py
index 209adeea47..26d0204080 100644
--- a/tests/unit/test_docs_reference.py
+++ b/tests/unit/test_docs_reference.py
@@ -40,12 +40,6 @@ def test_every_group_field_page_is_current() -> None:
assert not stale, f"stale field pages {stale}: run {gen.COMMAND}"
-def test_llms_txt_is_current() -> None:
- assert gen.LLMS_TXT.read_text(encoding="utf-8") == gen.render_llms_txt(), (
- f"llms.txt is stale: run {gen.COMMAND}"
- )
-
-
def test_listed_under_all_column_matches_the_mcp_listing(monkeypatch) -> None:
from server.operations import registry
from server.operations.toolsets import _MCP_HIDDEN_OPS, SYNTHETIC_TOOL_OPS
@@ -99,23 +93,3 @@ def test_status_ops_lists_each_experimental_op_once_and_counts_the_rest() -> Non
listed = [name for _, names in rows.values() for name in names]
assert sum(stable for stable, _ in rows.values()) + len(listed) == total
assert rendered[0] == f"{total} operations, {len(listed)} of them experimental."
-
-
-def test_llms_txt_puts_install_faq_and_contributor_pages_where_readers_expect() -> None:
- text = gen.render_llms_txt()
- sections = [line for line in text.splitlines() if line.startswith("## ")]
- # Contributor pages are last, in the section the llms.txt format lets a reader skip.
- assert sections[-1] == "## Optional"
- # What Loom is for leads: an agent that cuts the file short still reads it.
- assert sections[:4] == [
- "## Getting started",
- "## Use cases",
- "## FAQ and glossary",
- "## Concepts",
- ]
- assert "## Development" not in sections
- getting_started = text.split("## Getting started\n", 1)[1].split("\n## ", 1)[0]
- entries = [line for line in getting_started.splitlines() if line.startswith("- [")]
- # The plugin-free install route closes Getting started, after the section's own pages.
- assert entries[-1].startswith("- [Install Loom as an MCP server](llms-install.md): ")
- assert "docs/development/" in text.split("## Optional\n", 1)[1]
From 897714fa9d256baca6c56afc16daacd4aa5cbb2d Mon Sep 17 00:00:00 2001
From: Shaun Struwig <41984034+Blargian@users.noreply.github.com>
Date: Tue, 24 Nov 2026 15:16:12 +0100
Subject: [PATCH 05/16] Point locale LLM links at the documentation site
Signed-off-by: Shaun Struwig <41984034+Blargian@users.noreply.github.com>
---
docs/development/documentation-style.md | 2 +-
i18n/es/docs/development/documentation-style.md | 6 +++---
i18n/ja/docs/index.md | 2 +-
i18n/ko/docs/index.md | 2 +-
i18n/pt-BR/docs/index.md | 2 +-
i18n/zh-CN/docs/index.md | 2 +-
6 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/docs/development/documentation-style.md b/docs/development/documentation-style.md
index 8bc7124b47..6979b7386d 100644
--- a/docs/development/documentation-style.md
+++ b/docs/development/documentation-style.md
@@ -97,7 +97,7 @@ These pages are generated from the code or documentation source. Edit the source
| [reference/schema.md](../reference/schema.md) | `schemas/schema.sql` | `python scripts/codegen/docs_reference.py` |
On the documentation site, Blume serves each page's Markdown copy beside the page and
-publishes `llms.txt`, `llms-full.txt`, and the repository's `llms-install.md`.
+publishes `llms.txt` and `llms-full.txt`. `llms-install.md` remains in the repository.
The site publishes generated pages from `i18n//docs/` under `//`. English is the canonical default. Each page keeps its docs-relative path under `//`, so the homepage and use-case index have distinct routes. The English homepage links to each available translated homepage, or to its translated use-case index when the homepage is unavailable. Each translated page links to its English source and to the available equivalent translations. A notice marks translations whose source blob differs from the current English page. Translation generation stays in `scripts/i18n/translate.py`; the site build does not call a translation provider.
diff --git a/i18n/es/docs/development/documentation-style.md b/i18n/es/docs/development/documentation-style.md
index f806e9c72d..3374a27e8a 100644
--- a/i18n/es/docs/development/documentation-style.md
+++ b/i18n/es/docs/development/documentation-style.md
@@ -43,7 +43,7 @@ nothing is close enough. This page explains each leg, how the rank is computed,
which settings move it.
```
-`llms.txt` lista la primera oración de ese párrafo para la página, y el sitio de documentación la usa como descripción de búsqueda de la página. Después, donde correspondan: el comportamiento visible para el usuario, las interfaces (operaciones, CLI, ajustes), cómo funciona, límites y modos de fallo, y enlaces a "Related". Las páginas de arquitectura añaden **Source entry points** (rutas y símbolos) e **Invariants**.
+El sitio de documentación usa la primera oración de ese párrafo como descripción de búsqueda de la página y genera `llms.txt` a partir de ella. Después, donde correspondan: el comportamiento visible para el usuario, las interfaces (operaciones, CLI, ajustes), cómo funciona, límites y modos de fallo, y enlaces a "Related". Las páginas de arquitectura añaden **Source entry points** (rutas y símbolos) e **Invariants**.
@@ -108,7 +108,7 @@ Estas páginas se generan a partir del código. Edita la fuente y luego ejecuta
| ------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | ---------------------------------------------- |
| [reference/configuration.md](https://github.com/ClickHouse/loom/blob/main/docs/reference/configuration.md) | comentarios sobre los campos en `server/settings/` | `python scripts/codegen/settings_reference.py` |
| [reference/operations.md](https://github.com/ClickHouse/loom/blob/main/docs/reference/operations.md) | `server.operations.registry.ALL_OPERATIONS` | `python scripts/codegen/docs_reference.py` |
-| [`llms.txt`](https://github.com/ClickHouse/loom/blob/main/llms.txt) (raíz del repositorio) | el título de cada página y la primera frase de su párrafo inicial | `python scripts/codegen/docs_reference.py` |
+| `llms.txt` (sitio de documentación) | los títulos de las páginas de documentación y los párrafos iniciales | compilación del sitio Blume |
| `reference/operations/.md` (uno por grupo) | los modelos de entrada y salida de las ops y los comentarios sobre sus campos | `python scripts/codegen/docs_reference.py` |
| [reference/workers.md](https://github.com/ClickHouse/loom/blob/main/docs/reference/workers.md) | `server/workers/registry.py` (`_WORKERS`) | `python scripts/codegen/docs_reference.py` |
| [reference/cli.md](../reference/cli.md) | la instantánea del analizador de `loom` `tests/unit/snapshots/cli_tree.json` | `python scripts/codegen/docs_reference.py` |
@@ -116,7 +116,7 @@ Estas páginas se generan a partir del código. Edita la fuente y luego ejecuta
| [reference/status.md](https://github.com/ClickHouse/loom/blob/main/docs/reference/status.md) | la `maturity` de las ops y los ajustes booleanos de `server/settings/catalog.py` que se cargan como false | `python scripts/codegen/docs_reference.py` |
| [reference/schema.md](https://github.com/ClickHouse/loom/blob/main/docs/reference/schema.md) | `schemas/schema.sql` | `python scripts/codegen/docs_reference.py` |
-En el sitio de documentación, `scripts/docs_site/hooks.py` sirve la copia en Markdown de cada página junto a la propia página, en su URL más `index.html.md` y, para el índice de una sección, en `.md`, indicada mediante una etiqueta `` en la página; `llms.txt` con sus enlaces apuntando a esas copias; `llms-full.txt` (las páginas que explican qué es Loom y cómo empezar); y el `llms-install.md` del repositorio.
+En el sitio de documentación, Blume publica `llms.txt` y `llms-full.txt`. `llms-install.md` permanece en el repositorio.
El sitio publica las páginas generadas desde `i18n//docs/` bajo `//`. El inglés es el idioma predeterminado y canónico. Cada página conserva su ruta relativa a docs bajo `//`, de modo que la página de inicio y el índice de casos de uso tienen rutas distintas. La página de inicio en inglés enlaza a cada página de inicio traducida disponible, o a su índice de casos de uso traducido cuando la página de inicio no está disponible. Cada página traducida enlaza a su fuente en inglés y a las traducciones equivalentes disponibles. Un aviso marca las traducciones cuyo blob de origen difiere de la página actual en inglés. La generación de traducciones permanece en `scripts/i18n/translate.py`; la compilación del sitio no llama a ningún proveedor de traducción.
diff --git a/i18n/ja/docs/index.md b/i18n/ja/docs/index.md
index c525d2adc8..e5572013c1 100644
--- a/i18n/ja/docs/index.md
+++ b/i18n/ja/docs/index.md
@@ -211,4 +211,4 @@ Loom は、AI エージェント向けのメモリ、ドキュメント、コー
## 関連ページ
-[用語集](glossary.md):Loom の用語を一か所にまとめて定義しています。[よくある質問](faq.md):最初に出てくる質問に、それぞれ一段落で答えます。[`llms.txt`](https://github.com/ClickHouse/loom/blob/main/llms.txt):エージェント向けに生成されたドキュメントの索引です。[`llms-full.txt`](https://loom.clickhouse.com/docs/llms-full.txt) には、Loom とは何か、どう始めるかを説明するページが 1 つのファイルにまとめられています。
+[用語集](glossary.md):Loom の用語を一か所にまとめて定義しています。[よくある質問](faq.md):最初に出てくる質問に、それぞれ一段落で答えます。[`llms.txt`](https://loom.clickhouse.com/docs/llms.txt):エージェント向けに生成されたドキュメントの索引です。[`llms-full.txt`](https://loom.clickhouse.com/docs/llms-full.txt) には、Loom とは何か、どう始めるかを説明するページが 1 つのファイルにまとめられています。
diff --git a/i18n/ko/docs/index.md b/i18n/ko/docs/index.md
index 065336b048..398770ac10 100644
--- a/i18n/ko/docs/index.md
+++ b/i18n/ko/docs/index.md
@@ -228,4 +228,4 @@ TypeScript SDK, 그리고 대시보드를 통해 Loom에 접근합니다. 이
## 함께 보기
-[용어집](glossary.md): Loom의 용어를 한곳에 정리했습니다. [자주 묻는 질문](faq.md): 가장 먼저 나오는 질문과 한 단락짜리 답변입니다. [`llms.txt`](https://github.com/ClickHouse/loom/blob/main/llms.txt): 에이전트를 위해 생성한 문서 색인입니다. [`llms-full.txt`](https://loom.clickhouse.com/docs/llms-full.txt)에는 Loom이 무엇인지, 어떻게 시작하는지를 설명하는 페이지가 하나의 파일에 담겨 있습니다.
+[용어집](glossary.md): Loom의 용어를 한곳에 정리했습니다. [자주 묻는 질문](faq.md): 가장 먼저 나오는 질문과 한 단락짜리 답변입니다. [`llms.txt`](https://loom.clickhouse.com/docs/llms.txt): 에이전트를 위해 생성한 문서 색인입니다. [`llms-full.txt`](https://loom.clickhouse.com/docs/llms-full.txt)에는 Loom이 무엇인지, 어떻게 시작하는지를 설명하는 페이지가 하나의 파일에 담겨 있습니다.
diff --git a/i18n/pt-BR/docs/index.md b/i18n/pt-BR/docs/index.md
index 6a7bc4868c..40394218c7 100644
--- a/i18n/pt-BR/docs/index.md
+++ b/i18n/pt-BR/docs/index.md
@@ -228,6 +228,6 @@ O [CONTRIBUTING.md](https://github.com/ClickHouse/loom/blob/main/CONTRIBUTING.md
## Veja também
[Glossário](https://github.com/ClickHouse/loom/blob/main/docs/glossary.md): os termos do Loom, definidos uma única vez. [Perguntas frequentes](faq.md): as primeiras perguntas, um
-parágrafo para cada. [`llms.txt`](https://github.com/ClickHouse/loom/blob/main/llms.txt): um índice gerado da documentação para agentes;
+parágrafo para cada. [`llms.txt`](https://loom.clickhouse.com/docs/llms.txt): um índice gerado da documentação para agentes;
[`llms-full.txt`](https://loom.clickhouse.com/docs/llms-full.txt) reúne, em um único arquivo, as
páginas que explicam o que é o Loom e como começar.
diff --git a/i18n/zh-CN/docs/index.md b/i18n/zh-CN/docs/index.md
index 7a789a2ac6..526c7257f8 100644
--- a/i18n/zh-CN/docs/index.md
+++ b/i18n/zh-CN/docs/index.md
@@ -211,4 +211,4 @@ Loom 是面向 AI agent 的记忆、文档和代码索引服务器,数据存
## 另请参阅
-[术语表](https://github.com/ClickHouse/loom/blob/main/docs/glossary.md):Loom 的术语,每个只定义一次。[常见问题](faq.md):最先会遇到的问题,每个问题一段回答。[`llms.txt`](https://github.com/ClickHouse/loom/blob/main/llms.txt):为 agent 生成的文档索引;[`llms-full.txt`](https://loom.clickhouse.com/docs/llms-full.txt) 将说明 Loom 是什么以及如何开始使用的页面合并在一个文件中。
+[术语表](https://github.com/ClickHouse/loom/blob/main/docs/glossary.md):Loom 的术语,每个只定义一次。[常见问题](faq.md):最先会遇到的问题,每个问题一段回答。[`llms.txt`](https://loom.clickhouse.com/docs/llms.txt):为 agent 生成的文档索引;[`llms-full.txt`](https://loom.clickhouse.com/docs/llms-full.txt) 将说明 Loom 是什么以及如何开始使用的页面合并在一个文件中。
From a0a253f84f2d5ba248c78b9130e01c93ca362511 Mon Sep 17 00:00:00 2001
From: Shaun Struwig <41984034+Blargian@users.noreply.github.com>
Date: Tue, 24 Nov 2026 15:23:28 +0100
Subject: [PATCH 06/16] Remove retired publisher from locale docs
Signed-off-by: Shaun Struwig <41984034+Blargian@users.noreply.github.com>
---
i18n/ja/docs/development/repository-guide.md | 2 +-
i18n/ja/docs/development/testing.md | 2 +-
i18n/ko/docs/development/testing.md | 2 +-
i18n/pt-BR/docs/development/repository-guide.md | 2 +-
i18n/pt-BR/docs/development/testing.md | 8 ++------
i18n/zh-CN/docs/development/repository-guide.md | 2 +-
i18n/zh-CN/docs/development/testing.md | 2 +-
7 files changed, 8 insertions(+), 12 deletions(-)
diff --git a/i18n/ja/docs/development/repository-guide.md b/i18n/ja/docs/development/repository-guide.md
index 0b75c3a08e..69370b9688 100644
--- a/i18n/ja/docs/development/repository-guide.md
+++ b/i18n/ja/docs/development/repository-guide.md
@@ -29,7 +29,7 @@
| `tests/` | `unit/`、`integration/`、`analyzer/`、`code_lanes/`、`fixtures/`(後述) |
| `examples/` | 実行可能な統合例(`claude_agent_loop.py`、`ledger_run.py`、`log_conversation.py`、`onboarding_walkthrough.py`)と、教師が自分のリポジトリにコピーするコースのスターター(`course-starter/`、[教育](../guides/teaching.md#hand-out-the-labs-as-an-assignment)) |
| `i18n/` | README、クイックスタート、ユースケースページの機械翻訳。`LANGUAGES` の言語ごとに 1 フォルダー。`scripts/i18n/translate.py`(`.github/workflows/i18n.yml`)で生成され、手動では編集しない |
-| `docs/` | このドキュメント。`mkdocs.yml` と `scripts/docs_site/` がドキュメントサイトとしてビルドする(`.github/workflows/docs-site.yml`) |
+| `docs/` | このドキュメントと、`https://loom.clickhouse.com/docs/` で公開する Blume 設定 |
| `.github/` | CI、リリース、スキャンのワークフロー(`workflows/`)、issue とプルリクエストのテンプレート、`social-preview.png`(Settings → General → Social preview でアップロードする画像。GitHub はアップロードされたコピーのみを読む) |
| `.devcontainer/` | GitHub Codespaces のお試し環境:インストーラーで最新リリースをインストールし Claude Code を接続する dev container。開発環境ではない([クイックスタート](../getting-started/quickstart.md#try-it-in-github-codespaces)) |
| `Dockerfile`, `Makefile`, `redeploy.sh`, `pyproject.toml`, `uv.lock` | サーバーのイメージ、タスクランナー、ブルー/グリーンのデプロイスクリプト、サーバーパッケージとそのロックファイル |
diff --git a/i18n/ja/docs/development/testing.md b/i18n/ja/docs/development/testing.md
index 8ac686ac80..387fcd3d2e 100644
--- a/i18n/ja/docs/development/testing.md
+++ b/i18n/ja/docs/development/testing.md
@@ -165,7 +165,7 @@ python scripts/gates/mypy_gate.py --update
`.github/workflows/scorecard.yml` は、`main` へのプッシュ、毎週、および手動で OpenSSF Scorecard のチェックを実行します。README のバッジに表示されるスコアを公開し、検出結果をコードスキャンに追加します。プルリクエストでは実行されず、マージもブロックしません。
-`.github/workflows/docs-site.yml` は、`docs/`、`mkdocs.yml`、`llms.txt`、`llms-install.md`、`scripts/docs_site/`、`scripts/codegen/page_summary.py`、またはこのワークフロー自体に触れる `main` へのプルリクエストと、`main` へのすべてのプッシュで `mkdocs build --strict` によりドキュメントサイトをビルドします。そのため、壊れたリンクやアンカーは `docs site / build` チェックで失敗します。リポジトリ変数 `DOCS_SITE_ENABLED` が `true` の間だけ、`main` から GitHub Pages にサイトを公開します。
+`npm --prefix docs run build` は `docs/` パッケージからドキュメントサイトをビルドします。デプロイ設定は結果を `https://loom.clickhouse.com/docs/` で公開します。
別のブランチに積み重ねたプルリクエストは、`main` または `release/X.Y` ラインに付け替えるまでチェックが実行されません。マージコンフリクトのあるプルリクエストも同様です。プッシュ後に「no checks reported」と表示されたら、たいていはこのどちらかが原因です。
diff --git a/i18n/ko/docs/development/testing.md b/i18n/ko/docs/development/testing.md
index 1e317abf80..3b10e50b42 100644
--- a/i18n/ko/docs/development/testing.md
+++ b/i18n/ko/docs/development/testing.md
@@ -173,7 +173,7 @@ python scripts/gates/mypy_gate.py --update
`.github/workflows/scorecard.yml`은 `main`에 대한 푸시, 매주, 그리고 요청 시 OpenSSF Scorecard 검사를 실행합니다. README 배지에 표시되는 점수를 게시하고 결과를 코드 스캐닝에 추가하며, 풀 리퀘스트에서는 실행되지 않고 머지를 막지 않습니다.
-`.github/workflows/docs-site.yml`은 `docs/`, `mkdocs.yml`, `llms.txt`, `llms-install.md`, `scripts/docs_site/`, `scripts/codegen/page_summary.py` 또는 워크플로 자체를 건드리는 `main`으로의 풀 리퀘스트와 `main`에 대한 모든 푸시에서 `mkdocs build --strict`로 문서 사이트를 빌드하므로, 깨진 링크나 앵커는 `docs site / build` 체크를 실패시킵니다. 저장소 변수 `DOCS_SITE_ENABLED`가 `true`인 동안에만 `main`에서 사이트를 GitHub Pages에 게시합니다.
+`npm --prefix docs run build`는 `docs/` 패키지에서 문서 사이트를 빌드합니다. 배포 설정은 결과를 `https://loom.clickhouse.com/docs/`에 게시합니다.
다른 브랜치 위에 쌓인 풀 리퀘스트는 `main` 또는 `release/X.Y` 라인으로 대상을 변경하기 전까지 체크가 실행되지 않으며, 머지 충돌이 있는 풀 리퀘스트도 마찬가지입니다. 푸시 후 "no checks reported"가 보인다면 대개 둘 중 하나가 원인입니다.
diff --git a/i18n/pt-BR/docs/development/repository-guide.md b/i18n/pt-BR/docs/development/repository-guide.md
index e7f6c724c8..b8eb6f36dd 100644
--- a/i18n/pt-BR/docs/development/repository-guide.md
+++ b/i18n/pt-BR/docs/development/repository-guide.md
@@ -29,7 +29,7 @@ O que cada diretório de nível superior contém, onde cada responsabilidade fic
| `tests/` | `unit/`, `integration/`, `analyzer/`, `code_lanes/`, `fixtures/` (abaixo) |
| `examples/` | exemplos de integração executáveis (`claude_agent_loop.py`, `ledger_run.py`, `log_conversation.py`, `onboarding_walkthrough.py`) e o starter de curso que um professor copia para um repositório próprio (`course-starter/`, [ensino](https://github.com/ClickHouse/loom/blob/main/docs/guides/teaching.md#hand-out-the-labs-as-an-assignment)) |
| `i18n/` | traduções automáticas do README, do quickstart e das páginas de casos de uso, uma pasta por idioma em `LANGUAGES`; geradas por `scripts/i18n/translate.py` (`.github/workflows/i18n.yml`), nunca editadas manualmente |
-| `docs/` | esta documentação; `mkdocs.yml` e `scripts/docs_site/` a compilam como o site de documentação (`.github/workflows/docs-site.yml`) |
+| `docs/` | esta documentação e a configuração do Blume que a publica em `https://loom.clickhouse.com/docs/` |
| `.github/` | workflows de CI, release e varredura (`workflows/`), templates de issues e pull requests, e `social-preview.png`, a imagem enviada em Settings → General → Social preview (o GitHub lê apenas a cópia enviada) |
| `.devcontainer/` | o teste no GitHub Codespaces: um dev container que instala a última versão com o instalador e conecta o Claude Code; não é um ambiente de desenvolvimento ([guia de início rápido](../getting-started/quickstart.md#try-it-in-github-codespaces)) |
| `Dockerfile`, `Makefile`, `redeploy.sh`, `pyproject.toml`, `uv.lock` | a imagem do servidor, o executor de tarefas, o script de deploy blue/green, o pacote do servidor e seu arquivo de lock |
diff --git a/i18n/pt-BR/docs/development/testing.md b/i18n/pt-BR/docs/development/testing.md
index f80aaa05da..c67c6034cd 100644
--- a/i18n/pt-BR/docs/development/testing.md
+++ b/i18n/pt-BR/docs/development/testing.md
@@ -214,12 +214,8 @@ O `.github/workflows/scorecard.yml` executa as verificações do OpenSSF Scoreca
semanalmente e sob demanda. Ele publica a pontuação que o badge do README mostra e adiciona os achados
ao code scanning; não é executado em pull requests e não bloqueia nenhum merge.
-O `.github/workflows/docs-site.yml` compila o site de documentação com `mkdocs build --strict`
-em pull requests para `main` que tocam `docs/`, `mkdocs.yml`, `llms.txt`,
-`llms-install.md`, `scripts/docs_site/`, `scripts/codegen/page_summary.py` ou o próprio
-workflow, e em todo push para `main`, de modo que um link ou âncora quebrado faz a verificação
-`docs site / build` falhar. Ele publica o site no GitHub Pages somente a partir de `main` e somente enquanto a
-variável de repositório `DOCS_SITE_ENABLED` for `true`.
+`npm --prefix docs run build` compila o site de documentação a partir do pacote `docs/`. A
+configuração de deploy publica o resultado em `https://loom.clickhouse.com/docs/`.
Um pull request empilhado sobre outra branch não recebe verificações até ser redirecionado para `main` ou
uma linha `release/X.Y`, e um pull request com conflito de merge também não recebe nenhuma: "no checks
diff --git a/i18n/zh-CN/docs/development/repository-guide.md b/i18n/zh-CN/docs/development/repository-guide.md
index f0c7512b6f..d7a4e0ed49 100644
--- a/i18n/zh-CN/docs/development/repository-guide.md
+++ b/i18n/zh-CN/docs/development/repository-guide.md
@@ -29,7 +29,7 @@
| `tests/` | `unit/`、`integration/`、`analyzer/`、`code_lanes/`、`fixtures/`(见下文) |
| `examples/` | 可运行的集成示例(`claude_agent_loop.py`、`ledger_run.py`、`log_conversation.py`、`onboarding_walkthrough.py`),以及教师复制到自己仓库中的课程起始模板(`course-starter/`,[教学](https://github.com/ClickHouse/loom/blob/main/docs/guides/teaching.md#hand-out-the-labs-as-an-assignment)) |
| `i18n/` | README、快速开始和用例页面的机器翻译,`LANGUAGES` 中每种语言一个文件夹;由 `scripts/i18n/translate.py` 生成(`.github/workflows/i18n.yml`),从不手动编辑 |
-| `docs/` | 本文档;`mkdocs.yml` 和 `scripts/docs_site/` 将其构建为文档站点(`.github/workflows/docs-site.yml`) |
+| `docs/` | 本文档以及在 `https://loom.clickhouse.com/docs/` 发布它的 Blume 配置 |
| `.github/` | CI、发布和扫描工作流(`workflows/`)、issue 和 pull request 模板,以及 `social-preview.png`,即在 Settings → General → Social preview 中上传的图片(GitHub 只读取上传的副本) |
| `.devcontainer/` | GitHub Codespaces 试用环境:一个使用安装程序安装最新版本并连接 Claude Code 的 dev container;不是开发环境([快速开始](../getting-started/quickstart.md#try-it-in-github-codespaces)) |
| `Dockerfile`, `Makefile`, `redeploy.sh`, `pyproject.toml`, `uv.lock` | 服务器的镜像、任务运行器、蓝绿部署脚本、服务器包及其锁文件 |
diff --git a/i18n/zh-CN/docs/development/testing.md b/i18n/zh-CN/docs/development/testing.md
index a28be2f49c..952bcb32cf 100644
--- a/i18n/zh-CN/docs/development/testing.md
+++ b/i18n/zh-CN/docs/development/testing.md
@@ -165,7 +165,7 @@ python scripts/gates/mypy_gate.py --update
`.github/workflows/scorecard.yml` 在推送到 `main` 时、每周以及按需运行 OpenSSF Scorecard 检查。它发布 README 徽章所显示的分数,并把发现的问题加入代码扫描;它不在拉取请求上运行,也不阻塞合并。
-`.github/workflows/docs-site.yml` 在目标为 `main` 且改动了 `docs/`、`mkdocs.yml`、`llms.txt`、`llms-install.md`、`scripts/docs_site/`、`scripts/codegen/page_summary.py` 或该工作流本身的拉取请求上,以及每次推送到 `main` 时,用 `mkdocs build --strict` 构建文档站点,因此失效的链接或锚点会使 `docs site / build` 检查失败。仅当仓库变量 `DOCS_SITE_ENABLED` 为 `true` 时,它才会从 `main` 将站点发布到 GitHub Pages。
+`npm --prefix docs run build` 从 `docs/` 包构建文档站点。部署配置在 `https://loom.clickhouse.com/docs/` 发布结果。
堆叠在另一个分支上的拉取请求,在重新指向 `main` 或 `release/X.Y` 分支线之前不会运行任何检查;存在合并冲突的拉取请求同样不会运行检查:推送后出现“no checks reported”通常就是这两种情况之一。
From e6f38b151ea884057398895148ceb270d92b2b46 Mon Sep 17 00:00:00 2001
From: Shaun Struwig <41984034+Blargian@users.noreply.github.com>
Date: Tue, 24 Nov 2026 17:38:37 +0100
Subject: [PATCH 07/16] Remove retired documentation publisher hooks
The remaining hooks read the retired root index during a MkDocs build.
Signed-off-by: Shaun Struwig <41984034+Blargian@users.noreply.github.com>
---
.github/workflows/i18n.yml | 3 -
docs/development/repository-guide.md | 2 +-
i18n/es/README.md | 8 +-
.../docs/development/documentation-style.md | 6 +-
i18n/ja/README.md | 8 +-
i18n/ja/docs/development/repository-guide.md | 2 +-
i18n/ja/docs/development/testing.md | 2 +-
i18n/ja/docs/index.md | 2 +-
i18n/ko/README.md | 8 +-
i18n/ko/docs/development/testing.md | 2 +-
i18n/ko/docs/index.md | 2 +-
i18n/pt-BR/README.md | 8 +-
.../docs/development/repository-guide.md | 2 +-
i18n/pt-BR/docs/development/testing.md | 8 +-
i18n/pt-BR/docs/index.md | 4 +-
i18n/zh-CN/README.md | 8 +-
.../docs/development/repository-guide.md | 2 +-
i18n/zh-CN/docs/development/testing.md | 2 +-
i18n/zh-CN/docs/index.md | 2 +-
scripts/__init__.py | 3 +-
scripts/docs_site/hooks.py | 378 ---------
scripts/docs_site/indexnow.py | 53 +-
scripts/docs_site/locales.py | 364 ---------
scripts/docs_site/messages.py | 199 -----
.../overrides/partials/language.html | 4 -
.../overrides/partials/locales-head.html | 8 -
.../overrides/partials/locales-switch.html | 14 -
scripts/docs_site/overrides/sitemap.xml | 14 -
scripts/docs_site/video_labels.py | 73 --
scripts/{docs_site/paths.py => i18n/site.py} | 14 +-
scripts/i18n/translate.py | 8 +-
tests/unit/test_docs_site_hooks.py | 492 ------------
tests/unit/test_docs_site_indexnow.py | 17 +-
tests/unit/test_docs_site_locales.py | 737 ------------------
tests/unit/test_docs_site_video_labels.py | 76 --
tests/unit/test_i18n.py | 27 +-
tests/unit/test_i18n_lifecycle.py | 10 +-
37 files changed, 108 insertions(+), 2464 deletions(-)
delete mode 100644 scripts/docs_site/hooks.py
delete mode 100644 scripts/docs_site/locales.py
delete mode 100644 scripts/docs_site/messages.py
delete mode 100644 scripts/docs_site/overrides/partials/language.html
delete mode 100644 scripts/docs_site/overrides/partials/locales-head.html
delete mode 100644 scripts/docs_site/overrides/partials/locales-switch.html
delete mode 100644 scripts/docs_site/overrides/sitemap.xml
delete mode 100644 scripts/docs_site/video_labels.py
rename scripts/{docs_site/paths.py => i18n/site.py} (60%)
delete mode 100644 tests/unit/test_docs_site_hooks.py
delete mode 100644 tests/unit/test_docs_site_locales.py
delete mode 100644 tests/unit/test_docs_site_video_labels.py
diff --git a/.github/workflows/i18n.yml b/.github/workflows/i18n.yml
index da645e912a..6ff9f4874e 100644
--- a/.github/workflows/i18n.yml
+++ b/.github/workflows/i18n.yml
@@ -9,9 +9,6 @@ on:
- "README.md"
- "docs/**"
- "scripts/i18n/**"
- - "scripts/docs_site/messages.py"
- - "scripts/docs_site/indexnow.py"
- - "scripts/docs_site/paths.py"
- ".github/workflows/i18n.yml"
schedule:
- cron: "37 */6 * * *"
diff --git a/docs/development/repository-guide.md b/docs/development/repository-guide.md
index a0634450b7..301d03f6d9 100644
--- a/docs/development/repository-guide.md
+++ b/docs/development/repository-guide.md
@@ -17,7 +17,7 @@ What every top-level directory holds, where a concern lives inside `server/`, th
| `bench/` | benchmark harnesses and gates, their fixtures (`fixtures/`), datasets, rubrics, acceptance and skill evals; see [benchmarks](../benchmarks/overview.md) |
| `integrations/` | client integrations: the Claude Code and Codex plugins, the Cline hooks, the grep shim, Cursor and generic transcript hooks, the OKF CI gate |
| `skills/` | the standalone Agent Skills: `loom-code`, and `loom` (the agent guide the server image ships and `mentor.guide` serves) |
-| `scripts/` | `codegen/` (generators), `gates/` (CI ratchets and guards), `ops/` (operator tools), `scip_harness/` (compiler-tier producers), `docs_site/` (the documentation site's hook, theme override, pinned builder and IndexNow submission), `i18n/` (the translation generator and its freshness check) |
+| `scripts/` | `codegen/` (generators), `gates/` (CI ratchets and guards), `ops/` (operator tools), `scip_harness/` (compiler-tier producers), `docs_site/` (pinned packages for the translation parser), `i18n/` (the translation generator and its freshness check) |
| `tests/` | `unit/`, `integration/`, `analyzer/`, `code_lanes/`, `fixtures/` (below) |
| `examples/` | runnable integration examples (`claude_agent_loop.py`, `ledger_run.py`, `log_conversation.py`, `onboarding_walkthrough.py`), and the course starter a teacher copies into a repository of their own (`course-starter/`, [teaching](../guides/teaching.md#hand-out-the-labs-as-an-assignment)) |
| `i18n/` | machine translations of the README, the quickstart and the use-case pages, one folder per language in `LANGUAGES`; generated by `scripts/i18n/translate.py` (`.github/workflows/i18n.yml`), never edited by hand |
diff --git a/i18n/es/README.md b/i18n/es/README.md
index 7fb3f4e9fc..ecd4408206 100644
--- a/i18n/es/README.md
+++ b/i18n/es/README.md
@@ -32,7 +32,7 @@
Primeros pasos ·
Capacidades ·
Integraciones ·
- Documentación
+ Documentación
@@ -316,12 +316,12 @@ y los protocolos completos, los modelos y los artefactos.
## Documentación y contribución
Para contexto compartido entre agentes, inteligencia de código y recuperación con permisos, empieza por la
-[documentación](https://loom.clickhouse.com/docs/). Para conocer los requisitos de despliegue, consulta los
+[documentación](https://clickhouse.github.io/loom/). Para conocer los requisitos de despliegue, consulta los
[requisitos previos](https://github.com/ClickHouse/loom/blob/main/docs/getting-started/overview.md#prerequisites).
[Despliegue](https://github.com/ClickHouse/loom/blob/main/docs/operations/deployment.md) · [Preguntas frecuentes](https://github.com/ClickHouse/loom/blob/main/docs/faq.md) ·
[Cómo contribuir](https://github.com/ClickHouse/loom/blob/main/CONTRIBUTING.md) · [Reporte de seguridad](https://github.com/ClickHouse/loom/blob/main/SECURITY.md) ·
-[`llms.txt`](https://loom.clickhouse.com/docs/llms.txt) ·
-[`llms-full.txt`](https://loom.clickhouse.com/docs/llms-full.txt)
+[`llms.txt`](https://clickhouse.github.io/loom/llms.txt) ·
+[`llms-full.txt`](https://clickhouse.github.io/loom/llms-full.txt)
Apache-2.0 · [Licencia](https://github.com/ClickHouse/loom/blob/main/LICENSE) · [Aviso](https://github.com/ClickHouse/loom/blob/main/NOTICE)
diff --git a/i18n/es/docs/development/documentation-style.md b/i18n/es/docs/development/documentation-style.md
index 3374a27e8a..f806e9c72d 100644
--- a/i18n/es/docs/development/documentation-style.md
+++ b/i18n/es/docs/development/documentation-style.md
@@ -43,7 +43,7 @@ nothing is close enough. This page explains each leg, how the rank is computed,
which settings move it.
```
-El sitio de documentación usa la primera oración de ese párrafo como descripción de búsqueda de la página y genera `llms.txt` a partir de ella. Después, donde correspondan: el comportamiento visible para el usuario, las interfaces (operaciones, CLI, ajustes), cómo funciona, límites y modos de fallo, y enlaces a "Related". Las páginas de arquitectura añaden **Source entry points** (rutas y símbolos) e **Invariants**.
+`llms.txt` lista la primera oración de ese párrafo para la página, y el sitio de documentación la usa como descripción de búsqueda de la página. Después, donde correspondan: el comportamiento visible para el usuario, las interfaces (operaciones, CLI, ajustes), cómo funciona, límites y modos de fallo, y enlaces a "Related". Las páginas de arquitectura añaden **Source entry points** (rutas y símbolos) e **Invariants**.
@@ -108,7 +108,7 @@ Estas páginas se generan a partir del código. Edita la fuente y luego ejecuta
| ------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | ---------------------------------------------- |
| [reference/configuration.md](https://github.com/ClickHouse/loom/blob/main/docs/reference/configuration.md) | comentarios sobre los campos en `server/settings/` | `python scripts/codegen/settings_reference.py` |
| [reference/operations.md](https://github.com/ClickHouse/loom/blob/main/docs/reference/operations.md) | `server.operations.registry.ALL_OPERATIONS` | `python scripts/codegen/docs_reference.py` |
-| `llms.txt` (sitio de documentación) | los títulos de las páginas de documentación y los párrafos iniciales | compilación del sitio Blume |
+| [`llms.txt`](https://github.com/ClickHouse/loom/blob/main/llms.txt) (raíz del repositorio) | el título de cada página y la primera frase de su párrafo inicial | `python scripts/codegen/docs_reference.py` |
| `reference/operations/.md` (uno por grupo) | los modelos de entrada y salida de las ops y los comentarios sobre sus campos | `python scripts/codegen/docs_reference.py` |
| [reference/workers.md](https://github.com/ClickHouse/loom/blob/main/docs/reference/workers.md) | `server/workers/registry.py` (`_WORKERS`) | `python scripts/codegen/docs_reference.py` |
| [reference/cli.md](../reference/cli.md) | la instantánea del analizador de `loom` `tests/unit/snapshots/cli_tree.json` | `python scripts/codegen/docs_reference.py` |
@@ -116,7 +116,7 @@ Estas páginas se generan a partir del código. Edita la fuente y luego ejecuta
| [reference/status.md](https://github.com/ClickHouse/loom/blob/main/docs/reference/status.md) | la `maturity` de las ops y los ajustes booleanos de `server/settings/catalog.py` que se cargan como false | `python scripts/codegen/docs_reference.py` |
| [reference/schema.md](https://github.com/ClickHouse/loom/blob/main/docs/reference/schema.md) | `schemas/schema.sql` | `python scripts/codegen/docs_reference.py` |
-En el sitio de documentación, Blume publica `llms.txt` y `llms-full.txt`. `llms-install.md` permanece en el repositorio.
+En el sitio de documentación, `scripts/docs_site/hooks.py` sirve la copia en Markdown de cada página junto a la propia página, en su URL más `index.html.md` y, para el índice de una sección, en `.md`, indicada mediante una etiqueta `` en la página; `llms.txt` con sus enlaces apuntando a esas copias; `llms-full.txt` (las páginas que explican qué es Loom y cómo empezar); y el `llms-install.md` del repositorio.
El sitio publica las páginas generadas desde `i18n//docs/` bajo `//`. El inglés es el idioma predeterminado y canónico. Cada página conserva su ruta relativa a docs bajo `//`, de modo que la página de inicio y el índice de casos de uso tienen rutas distintas. La página de inicio en inglés enlaza a cada página de inicio traducida disponible, o a su índice de casos de uso traducido cuando la página de inicio no está disponible. Cada página traducida enlaza a su fuente en inglés y a las traducciones equivalentes disponibles. Un aviso marca las traducciones cuyo blob de origen difiere de la página actual en inglés. La generación de traducciones permanece en `scripts/i18n/translate.py`; la compilación del sitio no llama a ningún proveedor de traducción.
diff --git a/i18n/ja/README.md b/i18n/ja/README.md
index 87819fc631..219e5c1ffd 100644
--- a/i18n/ja/README.md
+++ b/i18n/ja/README.md
@@ -32,7 +32,7 @@
はじめに ·
機能 ·
連携 ·
- ドキュメント
+ ドキュメント
@@ -286,12 +286,12 @@ Langfuse와 ClickStack은 선택적 통합이며, Docker 스택에 포함된 서
## 문서 및 기여
공유 에이전트 컨텍스트, 코드 인텔리전스, 권한 기반 검색을 시작하려면
-[문서](https://loom.clickhouse.com/docs/)를 참고하세요. 배포 요구 사항은
+[문서](https://clickhouse.github.io/loom/)를 참고하세요. 배포 요구 사항은
[사전 요구 사항](https://github.com/ClickHouse/loom/blob/main/docs/getting-started/overview.md#prerequisites)을 참고하세요.
[배포](https://github.com/ClickHouse/loom/blob/main/docs/operations/deployment.md) · [자주 묻는 질문](https://github.com/ClickHouse/loom/blob/main/docs/faq.md) ·
[기여하기](https://github.com/ClickHouse/loom/blob/main/CONTRIBUTING.md) · [보안 문제 신고](https://github.com/ClickHouse/loom/blob/main/SECURITY.md) ·
-[`llms.txt`](https://loom.clickhouse.com/docs/llms.txt) ·
-[`llms-full.txt`](https://loom.clickhouse.com/docs/llms-full.txt)
+[`llms.txt`](https://clickhouse.github.io/loom/llms.txt) ·
+[`llms-full.txt`](https://clickhouse.github.io/loom/llms-full.txt)
Apache-2.0 · [라이선스](https://github.com/ClickHouse/loom/blob/main/LICENSE) · [고지 사항](https://github.com/ClickHouse/loom/blob/main/NOTICE)
diff --git a/i18n/ko/docs/development/testing.md b/i18n/ko/docs/development/testing.md
index 3b10e50b42..1e317abf80 100644
--- a/i18n/ko/docs/development/testing.md
+++ b/i18n/ko/docs/development/testing.md
@@ -173,7 +173,7 @@ python scripts/gates/mypy_gate.py --update
`.github/workflows/scorecard.yml`은 `main`에 대한 푸시, 매주, 그리고 요청 시 OpenSSF Scorecard 검사를 실행합니다. README 배지에 표시되는 점수를 게시하고 결과를 코드 스캐닝에 추가하며, 풀 리퀘스트에서는 실행되지 않고 머지를 막지 않습니다.
-`npm --prefix docs run build`는 `docs/` 패키지에서 문서 사이트를 빌드합니다. 배포 설정은 결과를 `https://loom.clickhouse.com/docs/`에 게시합니다.
+`.github/workflows/docs-site.yml`은 `docs/`, `mkdocs.yml`, `llms.txt`, `llms-install.md`, `scripts/docs_site/`, `scripts/codegen/page_summary.py` 또는 워크플로 자체를 건드리는 `main`으로의 풀 리퀘스트와 `main`에 대한 모든 푸시에서 `mkdocs build --strict`로 문서 사이트를 빌드하므로, 깨진 링크나 앵커는 `docs site / build` 체크를 실패시킵니다. 저장소 변수 `DOCS_SITE_ENABLED`가 `true`인 동안에만 `main`에서 사이트를 GitHub Pages에 게시합니다.
다른 브랜치 위에 쌓인 풀 리퀘스트는 `main` 또는 `release/X.Y` 라인으로 대상을 변경하기 전까지 체크가 실행되지 않으며, 머지 충돌이 있는 풀 리퀘스트도 마찬가지입니다. 푸시 후 "no checks reported"가 보인다면 대개 둘 중 하나가 원인입니다.
diff --git a/i18n/ko/docs/index.md b/i18n/ko/docs/index.md
index 398770ac10..fef2f5b584 100644
--- a/i18n/ko/docs/index.md
+++ b/i18n/ko/docs/index.md
@@ -228,4 +228,4 @@ TypeScript SDK, 그리고 대시보드를 통해 Loom에 접근합니다. 이
## 함께 보기
-[용어집](glossary.md): Loom의 용어를 한곳에 정리했습니다. [자주 묻는 질문](faq.md): 가장 먼저 나오는 질문과 한 단락짜리 답변입니다. [`llms.txt`](https://loom.clickhouse.com/docs/llms.txt): 에이전트를 위해 생성한 문서 색인입니다. [`llms-full.txt`](https://loom.clickhouse.com/docs/llms-full.txt)에는 Loom이 무엇인지, 어떻게 시작하는지를 설명하는 페이지가 하나의 파일에 담겨 있습니다.
+[용어집](glossary.md): Loom의 용어를 한곳에 정리했습니다. [자주 묻는 질문](faq.md): 가장 먼저 나오는 질문과 한 단락짜리 답변입니다. [`llms.txt`](https://github.com/ClickHouse/loom/blob/main/llms.txt): 에이전트를 위해 생성한 문서 색인입니다. [`llms-full.txt`](https://clickhouse.github.io/loom/llms-full.txt)에는 Loom이 무엇인지, 어떻게 시작하는지를 설명하는 페이지가 하나의 파일에 담겨 있습니다.
diff --git a/i18n/pt-BR/README.md b/i18n/pt-BR/README.md
index d7e52b3bb1..e65c7c7a62 100644
--- a/i18n/pt-BR/README.md
+++ b/i18n/pt-BR/README.md
@@ -32,7 +32,7 @@
Primeiros passos ·
Recursos ·
Integrações ·
- Documentação
+ Documentação
@@ -321,12 +321,12 @@ além dos protocolos completos, modelos e artefatos.
## Documentação e contribuição
Para contexto compartilhado de agentes, inteligência de código e recuperação com controle de permissões, comece pela
-[documentação](https://loom.clickhouse.com/docs/). Para os requisitos de implantação, consulte os
+[documentação](https://clickhouse.github.io/loom/). Para os requisitos de implantação, consulte os
[pré-requisitos](https://github.com/ClickHouse/loom/blob/main/docs/getting-started/overview.md#prerequisites).
[Implantação](https://github.com/ClickHouse/loom/blob/main/docs/operations/deployment.md) · [Perguntas frequentes](https://github.com/ClickHouse/loom/blob/main/docs/faq.md) ·
[Como contribuir](https://github.com/ClickHouse/loom/blob/main/CONTRIBUTING.md) · [Reporte de segurança](https://github.com/ClickHouse/loom/blob/main/SECURITY.md) ·
-[`llms.txt`](https://loom.clickhouse.com/docs/llms.txt) ·
-[`llms-full.txt`](https://loom.clickhouse.com/docs/llms-full.txt)
+[`llms.txt`](https://clickhouse.github.io/loom/llms.txt) ·
+[`llms-full.txt`](https://clickhouse.github.io/loom/llms-full.txt)
Apache-2.0 · [Licença](https://github.com/ClickHouse/loom/blob/main/LICENSE) · [Aviso](https://github.com/ClickHouse/loom/blob/main/NOTICE)
diff --git a/i18n/pt-BR/docs/development/repository-guide.md b/i18n/pt-BR/docs/development/repository-guide.md
index b8eb6f36dd..e7f6c724c8 100644
--- a/i18n/pt-BR/docs/development/repository-guide.md
+++ b/i18n/pt-BR/docs/development/repository-guide.md
@@ -29,7 +29,7 @@ O que cada diretório de nível superior contém, onde cada responsabilidade fic
| `tests/` | `unit/`, `integration/`, `analyzer/`, `code_lanes/`, `fixtures/` (abaixo) |
| `examples/` | exemplos de integração executáveis (`claude_agent_loop.py`, `ledger_run.py`, `log_conversation.py`, `onboarding_walkthrough.py`) e o starter de curso que um professor copia para um repositório próprio (`course-starter/`, [ensino](https://github.com/ClickHouse/loom/blob/main/docs/guides/teaching.md#hand-out-the-labs-as-an-assignment)) |
| `i18n/` | traduções automáticas do README, do quickstart e das páginas de casos de uso, uma pasta por idioma em `LANGUAGES`; geradas por `scripts/i18n/translate.py` (`.github/workflows/i18n.yml`), nunca editadas manualmente |
-| `docs/` | esta documentação e a configuração do Blume que a publica em `https://loom.clickhouse.com/docs/` |
+| `docs/` | esta documentação; `mkdocs.yml` e `scripts/docs_site/` a compilam como o site de documentação (`.github/workflows/docs-site.yml`) |
| `.github/` | workflows de CI, release e varredura (`workflows/`), templates de issues e pull requests, e `social-preview.png`, a imagem enviada em Settings → General → Social preview (o GitHub lê apenas a cópia enviada) |
| `.devcontainer/` | o teste no GitHub Codespaces: um dev container que instala a última versão com o instalador e conecta o Claude Code; não é um ambiente de desenvolvimento ([guia de início rápido](../getting-started/quickstart.md#try-it-in-github-codespaces)) |
| `Dockerfile`, `Makefile`, `redeploy.sh`, `pyproject.toml`, `uv.lock` | a imagem do servidor, o executor de tarefas, o script de deploy blue/green, o pacote do servidor e seu arquivo de lock |
diff --git a/i18n/pt-BR/docs/development/testing.md b/i18n/pt-BR/docs/development/testing.md
index c67c6034cd..f80aaa05da 100644
--- a/i18n/pt-BR/docs/development/testing.md
+++ b/i18n/pt-BR/docs/development/testing.md
@@ -214,8 +214,12 @@ O `.github/workflows/scorecard.yml` executa as verificações do OpenSSF Scoreca
semanalmente e sob demanda. Ele publica a pontuação que o badge do README mostra e adiciona os achados
ao code scanning; não é executado em pull requests e não bloqueia nenhum merge.
-`npm --prefix docs run build` compila o site de documentação a partir do pacote `docs/`. A
-configuração de deploy publica o resultado em `https://loom.clickhouse.com/docs/`.
+O `.github/workflows/docs-site.yml` compila o site de documentação com `mkdocs build --strict`
+em pull requests para `main` que tocam `docs/`, `mkdocs.yml`, `llms.txt`,
+`llms-install.md`, `scripts/docs_site/`, `scripts/codegen/page_summary.py` ou o próprio
+workflow, e em todo push para `main`, de modo que um link ou âncora quebrado faz a verificação
+`docs site / build` falhar. Ele publica o site no GitHub Pages somente a partir de `main` e somente enquanto a
+variável de repositório `DOCS_SITE_ENABLED` for `true`.
Um pull request empilhado sobre outra branch não recebe verificações até ser redirecionado para `main` ou
uma linha `release/X.Y`, e um pull request com conflito de merge também não recebe nenhuma: "no checks
diff --git a/i18n/pt-BR/docs/index.md b/i18n/pt-BR/docs/index.md
index 40394218c7..44a1e6f784 100644
--- a/i18n/pt-BR/docs/index.md
+++ b/i18n/pt-BR/docs/index.md
@@ -228,6 +228,6 @@ O [CONTRIBUTING.md](https://github.com/ClickHouse/loom/blob/main/CONTRIBUTING.md
## Veja também
[Glossário](https://github.com/ClickHouse/loom/blob/main/docs/glossary.md): os termos do Loom, definidos uma única vez. [Perguntas frequentes](faq.md): as primeiras perguntas, um
-parágrafo para cada. [`llms.txt`](https://loom.clickhouse.com/docs/llms.txt): um índice gerado da documentação para agentes;
-[`llms-full.txt`](https://loom.clickhouse.com/docs/llms-full.txt) reúne, em um único arquivo, as
+parágrafo para cada. [`llms.txt`](https://github.com/ClickHouse/loom/blob/main/llms.txt): um índice gerado da documentação para agentes;
+[`llms-full.txt`](https://clickhouse.github.io/loom/llms-full.txt) reúne, em um único arquivo, as
páginas que explicam o que é o Loom e como começar.
diff --git a/i18n/zh-CN/README.md b/i18n/zh-CN/README.md
index b05af350e9..52cea519d7 100644
--- a/i18n/zh-CN/README.md
+++ b/i18n/zh-CN/README.md
@@ -32,7 +32,7 @@
快速开始 ·
功能 ·
集成 ·
- 文档
+ 文档
@@ -234,11 +234,11 @@ Langfuse 和 ClickStack 是可选集成,不是 Docker 技术栈中自带的服
## 文档与贡献
-如需了解共享 agent 上下文、代码智能和带权限的检索,请从[文档](https://loom.clickhouse.com/docs/)开始。有关部署要求,请参阅[前提条件](https://github.com/ClickHouse/loom/blob/main/docs/getting-started/overview.md#prerequisites)。
+如需了解共享 agent 上下文、代码智能和带权限的检索,请从[文档](https://clickhouse.github.io/loom/)开始。有关部署要求,请参阅[前提条件](https://github.com/ClickHouse/loom/blob/main/docs/getting-started/overview.md#prerequisites)。
[部署](https://github.com/ClickHouse/loom/blob/main/docs/operations/deployment.md) · [常见问题](https://github.com/ClickHouse/loom/blob/main/docs/faq.md) ·
[参与贡献](https://github.com/ClickHouse/loom/blob/main/CONTRIBUTING.md) · [安全问题报告](https://github.com/ClickHouse/loom/blob/main/SECURITY.md) ·
-[`llms.txt`](https://loom.clickhouse.com/docs/llms.txt) ·
-[`llms-full.txt`](https://loom.clickhouse.com/docs/llms-full.txt)
+[`llms.txt`](https://clickhouse.github.io/loom/llms.txt) ·
+[`llms-full.txt`](https://clickhouse.github.io/loom/llms-full.txt)
Apache-2.0 · [许可证](https://github.com/ClickHouse/loom/blob/main/LICENSE) · [声明](https://github.com/ClickHouse/loom/blob/main/NOTICE)
diff --git a/i18n/zh-CN/docs/development/repository-guide.md b/i18n/zh-CN/docs/development/repository-guide.md
index d7a4e0ed49..f0c7512b6f 100644
--- a/i18n/zh-CN/docs/development/repository-guide.md
+++ b/i18n/zh-CN/docs/development/repository-guide.md
@@ -29,7 +29,7 @@
| `tests/` | `unit/`、`integration/`、`analyzer/`、`code_lanes/`、`fixtures/`(见下文) |
| `examples/` | 可运行的集成示例(`claude_agent_loop.py`、`ledger_run.py`、`log_conversation.py`、`onboarding_walkthrough.py`),以及教师复制到自己仓库中的课程起始模板(`course-starter/`,[教学](https://github.com/ClickHouse/loom/blob/main/docs/guides/teaching.md#hand-out-the-labs-as-an-assignment)) |
| `i18n/` | README、快速开始和用例页面的机器翻译,`LANGUAGES` 中每种语言一个文件夹;由 `scripts/i18n/translate.py` 生成(`.github/workflows/i18n.yml`),从不手动编辑 |
-| `docs/` | 本文档以及在 `https://loom.clickhouse.com/docs/` 发布它的 Blume 配置 |
+| `docs/` | 本文档;`mkdocs.yml` 和 `scripts/docs_site/` 将其构建为文档站点(`.github/workflows/docs-site.yml`) |
| `.github/` | CI、发布和扫描工作流(`workflows/`)、issue 和 pull request 模板,以及 `social-preview.png`,即在 Settings → General → Social preview 中上传的图片(GitHub 只读取上传的副本) |
| `.devcontainer/` | GitHub Codespaces 试用环境:一个使用安装程序安装最新版本并连接 Claude Code 的 dev container;不是开发环境([快速开始](../getting-started/quickstart.md#try-it-in-github-codespaces)) |
| `Dockerfile`, `Makefile`, `redeploy.sh`, `pyproject.toml`, `uv.lock` | 服务器的镜像、任务运行器、蓝绿部署脚本、服务器包及其锁文件 |
diff --git a/i18n/zh-CN/docs/development/testing.md b/i18n/zh-CN/docs/development/testing.md
index 952bcb32cf..a28be2f49c 100644
--- a/i18n/zh-CN/docs/development/testing.md
+++ b/i18n/zh-CN/docs/development/testing.md
@@ -165,7 +165,7 @@ python scripts/gates/mypy_gate.py --update
`.github/workflows/scorecard.yml` 在推送到 `main` 时、每周以及按需运行 OpenSSF Scorecard 检查。它发布 README 徽章所显示的分数,并把发现的问题加入代码扫描;它不在拉取请求上运行,也不阻塞合并。
-`npm --prefix docs run build` 从 `docs/` 包构建文档站点。部署配置在 `https://loom.clickhouse.com/docs/` 发布结果。
+`.github/workflows/docs-site.yml` 在目标为 `main` 且改动了 `docs/`、`mkdocs.yml`、`llms.txt`、`llms-install.md`、`scripts/docs_site/`、`scripts/codegen/page_summary.py` 或该工作流本身的拉取请求上,以及每次推送到 `main` 时,用 `mkdocs build --strict` 构建文档站点,因此失效的链接或锚点会使 `docs site / build` 检查失败。仅当仓库变量 `DOCS_SITE_ENABLED` 为 `true` 时,它才会从 `main` 将站点发布到 GitHub Pages。
堆叠在另一个分支上的拉取请求,在重新指向 `main` 或 `release/X.Y` 分支线之前不会运行任何检查;存在合并冲突的拉取请求同样不会运行检查:推送后出现“no checks reported”通常就是这两种情况之一。
diff --git a/i18n/zh-CN/docs/index.md b/i18n/zh-CN/docs/index.md
index 526c7257f8..4fb87be6d7 100644
--- a/i18n/zh-CN/docs/index.md
+++ b/i18n/zh-CN/docs/index.md
@@ -211,4 +211,4 @@ Loom 是面向 AI agent 的记忆、文档和代码索引服务器,数据存
## 另请参阅
-[术语表](https://github.com/ClickHouse/loom/blob/main/docs/glossary.md):Loom 的术语,每个只定义一次。[常见问题](faq.md):最先会遇到的问题,每个问题一段回答。[`llms.txt`](https://loom.clickhouse.com/docs/llms.txt):为 agent 生成的文档索引;[`llms-full.txt`](https://loom.clickhouse.com/docs/llms-full.txt) 将说明 Loom 是什么以及如何开始使用的页面合并在一个文件中。
+[术语表](https://github.com/ClickHouse/loom/blob/main/docs/glossary.md):Loom 的术语,每个只定义一次。[常见问题](faq.md):最先会遇到的问题,每个问题一段回答。[`llms.txt`](https://github.com/ClickHouse/loom/blob/main/llms.txt):为 agent 生成的文档索引;[`llms-full.txt`](https://clickhouse.github.io/loom/llms-full.txt) 将说明 Loom 是什么以及如何开始使用的页面合并在一个文件中。
diff --git a/scripts/__init__.py b/scripts/__init__.py
index 28d55ec6f0..a50df12c7f 100644
--- a/scripts/__init__.py
+++ b/scripts/__init__.py
@@ -10,6 +10,5 @@
dump that writes `schemas/schema.sql`, the load benchmark, table rebuilds,
the call-graph edge audit, the backup drill and the code-intel bootstrap.
- `scip_harness/`: compiler-tier index producers; server workers call them by path.
-- `docs_site/`: the documentation site's MkDocs hook, theme override, pinned builder and
- IndexNow submission.
+- `docs_site/`: pinned packages for the translation parser.
"""
diff --git a/scripts/docs_site/hooks.py b/scripts/docs_site/hooks.py
deleted file mode 100644
index e455d95fff..0000000000
--- a/scripts/docs_site/hooks.py
+++ /dev/null
@@ -1,378 +0,0 @@
-"""MkDocs hooks for the documentation site built from docs/.
-
-Each page's meta description is its first sentence, the line llms.txt lists for it, cut to
-160 characters, so a search result shows the answer the page opens with. An inline
-Markdown link or image that leaves docs/ (source files, the README) points at the file on
-GitHub instead of a missing page, except the root files the site serves itself (`llms.txt`,
-`llms-install.md`), which point at the site; links in code blocks and code spans are left
-as written, and reference-style links are not rewritten (the docs use inline links). The
-sidebar follows the sections' order in `SECTIONS`, the FAQ and glossary last; within a
-folder its index page (`index.md`, or `overview.md` without one) comes first, then
-Quickstart in Getting started; a generated page gets no edit button (its source is the
-generator, not the page).
-
-After the build, the site also serves what agents fetch instead of HTML: each page's
-Markdown beside it (`use-cases/agent-memory.md`) and at the page URL plus `index.html.md` (a
-section index also at `.md`, such as `use-cases.md`), `llms.txt` with its links
-pointing at those files, `llms-full.txt` with the full text of the pages that say what Loom
-is and how to start (the whole docs are several megabytes), and the repository's
-`llms-install.md`.
-"""
-
-from __future__ import annotations
-
-import html
-import posixpath
-import re
-import sys
-from html.parser import HTMLParser
-from pathlib import Path
-
-ROOT = Path(__file__).resolve().parents[2]
-if str(ROOT) not in sys.path:
- sys.path.insert(0, str(ROOT))
-from scripts.codegen.page_summary import SECTIONS, page_key, page_summary, shorten # noqa: E402
-from scripts.docs_site.paths import page_path # noqa: E402
-
-BLOB = "https://github.com/ClickHouse/loom/blob/main/"
-RAW = "https://raw.githubusercontent.com/ClickHouse/loom/main/"
-# The generators' whole-page markers; a page with generated regions ("not this region")
-# keeps its edit button.
-_WHOLLY_GENERATED = re.compile(
- r"")
-
-
-def localized_uri(language: str, source: str) -> str:
- """Preserve each source path under its language prefix."""
- return f"{language}/{source}"
-
-
-def localized_page_path(path: str, *, languages: Iterable[str] | None = None) -> str | None:
- """The site path for an existing or deleted repository translation."""
- parts = path.split("/", 3)
- if (
- len(parts) != 4
- or parts[0] != "i18n"
- or parts[1] not in LANGUAGES
- or parts[1] not in (PUBLISHED_LANGUAGES if languages is None else languages)
- or parts[2] != "docs"
- or not parts[3].endswith(".md")
- ):
- return None
- return quote(page_path(f"docs/{localized_uri(parts[1], parts[3])}"))
-
-
-def translations(root: Path, *, languages: Iterable[str] | None = None) -> dict[str, dict]:
- pages = {}
- for language in PUBLISHED_LANGUAGES if languages is None else languages:
- for path in sorted((root / "i18n" / language / "docs").rglob("*.md")):
- source = path.relative_to(root / "i18n" / language / "docs").as_posix()
- english = root / "docs" / source
- stamp = _STAMP.match(path.read_text(encoding="utf-8"))
- obsolete = not english.is_file()
- if obsolete and (stamp is None or stamp.group(1) != f"docs/{source}"):
- continue
- blob = None
- if not obsolete:
- content = english.read_bytes()
- blob = hashlib.sha1(f"blob {len(content)}\0".encode() + content).hexdigest()
- pages[localized_uri(language, source)] = {
- "language": language,
- "source": source,
- "path": str(path),
- "obsolete": obsolete,
- "stale": obsolete
- or stamp is None
- or stamp.group(1) != f"docs/{source}"
- or stamp.group(2) != blob,
- }
- return pages
-
-
-def on_files(files, config):
- from mkdocs.structure.files import File, InclusionLevel
-
- pages = config.extra["locale_pages"] = translations(ROOT)
- for uri, entry in pages.items():
- entry["title"] = page_summary(Path(entry["path"]))[0]
- files.append(
- File.generated(
- config,
- uri,
- abs_src_path=entry["path"],
- inclusion=InclusionLevel.NOT_IN_NAV,
- )
- )
- return files
-
-
-def alternates(source: str, pages: dict, site_url: str) -> list[dict[str, str]]:
- available = [
- {
- "lang": entry["language"],
- "name": LANGUAGES[entry["language"]],
- "url": site_url + quote(page_path(f"docs/{uri}")),
- }
- for uri, entry in pages.items()
- if entry["source"] == source and not entry["obsolete"]
- ]
- if not available:
- return []
- english = {
- "lang": "en",
- "name": "English",
- "url": site_url + quote(page_path(f"docs/{source}")),
- }
- return [english, *available, {**english, "lang": "x-default"}]
-
-
-def language_landings(pages: dict, site_url: str) -> list[dict[str, str]]:
- landings = []
- for language, name in LANGUAGES.items():
- uri = landing_uri(language, pages)
- if uri:
- landings.append(
- {"lang": language, "name": name, "url": site_url + quote(page_path(f"docs/{uri}"))}
- )
- return landings
-
-
-def landing_uri(language: str, pages: dict) -> str | None:
- available = landing_sources(
- uri.removeprefix(language + "/")
- for uri, entry in pages.items()
- if entry["language"] == language and not entry["obsolete"]
- )
- return localized_uri(language, available[0]) if available else None
-
-
-def language_choices(source: str, pages: dict, site_url: str) -> list[dict]:
- """Offer an equivalent page or a named existing landing, never a missing URL."""
- choices = [
- {
- "lang": "en",
- "name": "English",
- "url": site_url + quote(page_path(f"docs/{source}")),
- "landing": "",
- }
- ]
- for landing in language_landings(pages, site_url):
- code, name = landing["lang"], landing["name"]
- equivalent = localized_uri(code, source)
- uri = (
- equivalent
- if equivalent in pages and not pages[equivalent]["obsolete"]
- else landing_uri(code, pages)
- )
- if uri is None:
- continue
- entry = pages[uri]
- choices.append(
- {
- "lang": code,
- "name": name,
- "url": site_url + quote(page_path(f"docs/{uri}")),
- "landing": ""
- if uri == equivalent
- else entry.get("title") or page_summary(Path(entry["path"]))[0],
- }
- )
- return choices
-
-
-def on_nav(nav, config, files):
- config.extra["locale_nav_pages"] = {
- file.src_uri: file.page for file in files if file.src_uri in config.extra["locale_pages"]
- }
- return nav
-
-
-def localized_navigation(nav, page, config):
- """Project the shared English navigation without changing any shared node."""
- language = page.meta["language"]
- pages = config.extra["locale_pages"]
- localized = config.extra["locale_nav_pages"]
- projected = []
- has_fallback = False
-
- def item_view(item, parent=None):
- nonlocal has_fallback
- target = item
- entry = None
- if item.is_page:
- uri = localized_uri(language, item.file.src_uri)
- entry = pages.get(uri)
- if entry and not entry["obsolete"]:
- target = localized[uri]
- else:
- entry = None
- has_fallback = True
- view = copy(target)
- view.parent = parent
- if item.is_section:
- view.children = [item_view(child, view) for child in item.children]
- view.title = SECTION_TITLES[language].get(
- item.title, f"{item.title} ({COPY[language]['english']})"
- )
- view.active = any(child.active for child in view.children)
- elif item.is_page:
- view.typeset = None
- view.title = (
- (entry.get("title") or page_summary(Path(entry["path"]))[0])
- if entry
- else f"{item.title} ({COPY[language]['english']})"
- )
- view.active = view.file.src_uri == page.file.src_uri
- projected.append(view)
- return view
-
- result = copy(nav)
- result.items = [item_view(item) for item in nav.items]
- result.pages = projected
- for index, item in enumerate(projected):
- item.previous_page = projected[index - 1] if index else None
- item.next_page = projected[index + 1] if index + 1 < len(projected) else None
- home = landing_uri(language, pages)
- if home:
- result.homepage = localized[home]
- return result, has_fallback
-
-
-def on_page_context(context, page, config, nav):
- if page.meta.get("language", "en") == "en":
- return context
- projected, fallback = localized_navigation(nav, page, config)
- context["nav"] = projected
- context["locale_has_english_fallback"] = fallback
- current = next(
- (item for item in projected.pages if item.file.src_uri == page.file.src_uri), None
- )
- if current:
- context["page"] = current
- return context
-
-
-def _link_target(target: str, entry: dict, pages: dict, site_url: str, *, banner: bool) -> str:
- language = entry["language"]
- if target.startswith(BLOB + "docs/"):
- if not banner:
- # The producer chooses English when a translated anchor is absent.
- return target
- source = unquote(target[len(BLOB + "docs/") :])
- elif target.startswith(BLOB + "i18n/"):
- parts = unquote(target[len(BLOB + "i18n/") :]).split("/", 2)
- if len(parts) != 3 or parts[1] != "docs":
- return target
- language, _, source = parts
- elif target and not re.match(r"(?:[a-zA-Z][\w+.-]*:|/)", target):
- source = posixpath.normpath(
- posixpath.join(posixpath.dirname(entry["source"]), unquote(target))
- )
- if source.startswith("../"):
- repository = posixpath.normpath(posixpath.join("docs", source))
- translated = f"i18n/{language}/{repository}"
- return BLOB + quote(translated if (ROOT / translated).is_file() else repository)
- else:
- return target
- uri = localized_uri(language, source)
- if not banner and uri in pages:
- return site_url + quote(page_path(f"docs/{uri}"))
- if not (ROOT / "docs" / source).is_file():
- return target
- if not source.endswith(".md"):
- return site_url + quote(source)
- if banner or uri not in pages:
- uri = source
- return site_url + quote(page_path(f"docs/{uri}"))
-
-
-def translated_markdown(markdown: str, entry: dict, pages: dict, site_url: str) -> str:
- # Explicit English fallbacks retain the producer's anchor-safety decision.
- header, separator, body = markdown.partition("\n\n")
- if entry.get("obsolete"):
- if not separator:
- header, _, body = markdown.partition("\n")
- separator = "\n\n"
- header = header.split("\n", 1)[0]
- ui = COPY[entry["language"]]
- body = (
- f'
-{% endif %}
diff --git a/scripts/docs_site/overrides/sitemap.xml b/scripts/docs_site/overrides/sitemap.xml
deleted file mode 100644
index 22b9e6759b..0000000000
--- a/scripts/docs_site/overrides/sitemap.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-{# The legacy site serves redirects. MkDocs supplies a build date for update_date. #}
-
-{% for file in pages %}
-{% if not file.page.is_link and (file.page.abs_url or file.page.canonical_url) %}
-
- {{ (file.page.canonical_url or file.page.abs_url) | e }}
- {% for alternate in file.page.meta.alternates %}
-
- {% endfor %}
-
-{% endif %}
-{% endfor %}
-
diff --git a/scripts/docs_site/video_labels.py b/scripts/docs_site/video_labels.py
deleted file mode 100644
index 1581092442..0000000000
--- a/scripts/docs_site/video_labels.py
+++ /dev/null
@@ -1,73 +0,0 @@
-"""Use a translated video's fallback text as its accessible label."""
-
-from __future__ import annotations
-
-import html
-from html.parser import HTMLParser
-from itertools import accumulate
-
-
-class _VideoLabels(HTMLParser):
- def __init__(self, content: str):
- super().__init__(convert_charrefs=True)
- self.offsets = list(accumulate([0, *(len(line) + 1 for line in content.split("\n"))]))
- self.video: tuple[int, str, list[tuple[str, str | None]]] | None = None
- self.caption: list[str] = []
- self.link_depth = 0
- self.raw_text: str | None = None
- self.replacements: list[tuple[int, int, str]] = []
-
- def handle_starttag(self, tag, attrs):
- if self.raw_text is not None:
- return
- if tag in {"textarea", "title", "script", "style"}:
- self.raw_text = tag
- return
- if tag == "video" and self.video is None:
- line, column = self.getpos()
- opening = self.get_starttag_text()
- assert opening is not None
- self.video = (self.offsets[line - 1] + column, opening, attrs)
- self.caption = []
- elif tag == "a" and self.video is not None:
- self.link_depth += 1
- elif tag == "br" and self.link_depth:
- self.caption.append(" ")
-
- def handle_data(self, data):
- if self.video is not None and self.link_depth and self.raw_text is None:
- self.caption.append(data)
-
- def handle_endtag(self, tag):
- if self.raw_text is not None:
- if tag == self.raw_text:
- self.raw_text = None
- return
- if tag == "a" and self.link_depth:
- self.link_depth -= 1
- elif tag == "video" and self.video is not None:
- start, opening, attrs = self.video
- label = " ".join("".join(self.caption).split())
- if label and any(name == "aria-label" for name, _value in attrs):
- attributes = []
- for name, value in attrs:
- if name == "aria-label":
- value = label
- attributes.append(
- name if value is None else f'{name}="{html.escape(value, quote=True)}"'
- )
- self.replacements.append(
- (start, start + len(opening), f"' in output
-
-
-@pytest.mark.parametrize(
- ("language", "body"),
- [
- ("en", 'English caption'),
- ("ja", ''),
- ("ja", ''),
- ("ja", "出典を確認"),
- ("ja", '
<video aria-label="Example">
'),
- ("ja", ''),
- ("ja", 'Literal'),
- ("ja", ""),
- ],
-)
-def test_video_label_projection_leaves_other_content(language, body):
- text = f'{body}'
- assert locales.on_post_page(text, SimpleNamespace(meta={"language": language}), None) == text
-
-
-def test_each_video_keeps_its_own_fallback_and_escaped_label():
- text = (
- '最初 "引用"\n'
- '次の <例>'
- )
- output = locales.on_post_page(text, SimpleNamespace(meta={"language": "ja"}), None)
- assert [attrs["aria-label"] for attrs in _Videos(output).attributes] == [
- '最初 "引用"',
- "次の <例>",
- ]
diff --git a/tests/unit/test_i18n.py b/tests/unit/test_i18n.py
index f6aae60bf3..30c943ce66 100644
--- a/tests/unit/test_i18n.py
+++ b/tests/unit/test_i18n.py
@@ -471,10 +471,10 @@ def test_a_new_language_is_linked_from_every_readme_without_translating(
def test_translated_readme_links_to_its_existing_site_landing(tmp_path, monkeypatch) -> None:
- from scripts.docs_site import indexnow
+ from scripts.i18n import site
monkeypatch.setattr(t, "ROOT", tmp_path)
- monkeypatch.setattr(indexnow, "SITE", "https://example.com/docs/")
+ monkeypatch.setattr(site, "SITE", "https://example.com/docs/")
for source in ("README.md", "docs/index.md", "docs/use-cases/index.md"):
path = tmp_path / source
path.parent.mkdir(parents=True, exist_ok=True)
@@ -501,15 +501,13 @@ def test_translated_readme_links_to_its_existing_site_landing(tmp_path, monkeypa
assert "https://example.com" not in t.language_line("i18n/es/README.md")
-def test_generated_readme_uses_the_mkdocs_default_site_base() -> None:
- import yaml
+def test_generated_readme_uses_the_documentation_site_base() -> None:
+ from scripts.i18n import site
- from scripts.docs_site import indexnow
-
- config = yaml.compose((ROOT / "mkdocs.yml").read_text())
- site_url = next(value for key, value in config.value if key.value == "site_url")
- assert site_url.tag == "!ENV"
- assert [item.value for item in site_url.value] == ["LOOM_LEGACY_DOCS_URL", indexnow.SITE]
+ config = (ROOT / "docs/blume.config.ts").read_text()
+ assert 'site: new URL(siteUrl).origin' in config
+ assert 'base: "/docs"' in config
+ assert site.SITE == "https://loom.clickhouse.com/docs/"
@pytest.mark.parametrize(
@@ -530,11 +528,11 @@ def test_readme_keeps_a_native_site_link_without_a_translated_index(
) -> None:
from html.parser import HTMLParser
- from scripts.docs_site import indexnow, locales
+ from scripts.i18n import site
class Links(HTMLParser):
def handle_starttag(self, tag, attrs):
- if tag == "a" and dict(attrs).get("href", "").startswith(indexnow.SITE):
+ if tag == "a" and dict(attrs).get("href", "").startswith(site.SITE):
links.append(dict(attrs))
monkeypatch.setattr(t, "ROOT", tmp_path)
@@ -546,11 +544,10 @@ def handle_starttag(self, tag, attrs):
target = tmp_path / t.target_path(language.code, source)
target.parent.mkdir(parents=True, exist_ok=True)
target.write_text(t.header(source, language, t.DEFAULT_MODEL, t.blob(source)) + "# Loom\n")
- uri = locales.landing_uri(language.code, locales.translations(tmp_path))
- assert uri == language.code + "/" + expected
+ assert site.landing_sources(sources)[0] == expected
links = []
Links().feed(t.language_line("i18n/ja/README.md"))
- assert links == [{"href": indexnow.SITE + "ja/" + route}]
+ assert links == [{"href": site.SITE + "ja/" + route}]
def _translations() -> list[tuple[str, t.Language]]:
diff --git a/tests/unit/test_i18n_lifecycle.py b/tests/unit/test_i18n_lifecycle.py
index 6162dedfd1..f31af2bc71 100644
--- a/tests/unit/test_i18n_lifecycle.py
+++ b/tests/unit/test_i18n_lifecycle.py
@@ -62,8 +62,6 @@ def publish(root: pathlib.Path, source: str) -> None:
def test_subset_retires_its_landing_and_preserves_other_readme_navigation(
repo: pathlib.Path, monkeypatch: pytest.MonkeyPatch, preferred: str
) -> None:
- from scripts.docs_site import locales
-
put(repo, "README.md", "# Loom\n\n\n\n")
landings = {preferred, "docs/use-cases/index.md"}
for source in landings:
@@ -106,8 +104,6 @@ def translate(source, lang, client, spend):
assert calls == [("docs/extra.md", "ja")]
assert not (repo / t.target_path("ja", preferred)).exists()
assert (repo / t.target_path("es", preferred)).is_file()
- retained_uri = locales.localized_uri("es", preferred.removeprefix("docs/"))
- assert locales.translations(repo)[retained_uri]["obsolete"]
assert spanish.read_bytes() == retained
assert not t.language_lines_differ()
assert t.check(skip_stale=True) == 0
@@ -119,7 +115,7 @@ def translate(source, lang, client, spend):
def test_retiring_the_last_native_landing_removes_the_readme_site_link(repo: pathlib.Path) -> None:
- from scripts.docs_site import indexnow
+ from scripts.i18n import site
put(repo, "README.md", "# Loom\n\n\n\n")
put(repo, "docs/index.md", "# Alpha\n")
@@ -127,10 +123,10 @@ def test_retiring_the_last_native_landing_removes_the_readme_site_link(repo: pat
for source in ("README.md", "docs/index.md"):
publish(repo, source)
t.write_language_lines()
- assert indexnow.SITE in t.language_line("i18n/ja/README.md")
+ assert site.SITE in t.language_line("i18n/ja/README.md")
(repo / "docs/index.md").unlink()
assert lc.retire_obsolete(["ja"]) == (1, 0)
- assert indexnow.SITE not in (repo / "i18n/ja/README.md").read_text()
+ assert site.SITE not in (repo / "i18n/ja/README.md").read_text()
assert not t.language_lines_differ()
assert t.check(skip_stale=True) == 0
From 09af6145644848f1c33f1957f32022973810c5f2 Mon Sep 17 00:00:00 2001
From: Shaun Struwig <41984034+Blargian@users.noreply.github.com>
Date: Tue, 24 Nov 2026 18:21:07 +0100
Subject: [PATCH 08/16] Format repository guide table
The documentation formatter removes the extra alignment space.
Signed-off-by: Shaun Struwig <41984034+Blargian@users.noreply.github.com>
---
docs/development/repository-guide.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/development/repository-guide.md b/docs/development/repository-guide.md
index 301d03f6d9..970edc74f2 100644
--- a/docs/development/repository-guide.md
+++ b/docs/development/repository-guide.md
@@ -17,7 +17,7 @@ What every top-level directory holds, where a concern lives inside `server/`, th
| `bench/` | benchmark harnesses and gates, their fixtures (`fixtures/`), datasets, rubrics, acceptance and skill evals; see [benchmarks](../benchmarks/overview.md) |
| `integrations/` | client integrations: the Claude Code and Codex plugins, the Cline hooks, the grep shim, Cursor and generic transcript hooks, the OKF CI gate |
| `skills/` | the standalone Agent Skills: `loom-code`, and `loom` (the agent guide the server image ships and `mentor.guide` serves) |
-| `scripts/` | `codegen/` (generators), `gates/` (CI ratchets and guards), `ops/` (operator tools), `scip_harness/` (compiler-tier producers), `docs_site/` (pinned packages for the translation parser), `i18n/` (the translation generator and its freshness check) |
+| `scripts/` | `codegen/` (generators), `gates/` (CI ratchets and guards), `ops/` (operator tools), `scip_harness/` (compiler-tier producers), `docs_site/` (pinned packages for the translation parser), `i18n/` (the translation generator and its freshness check) |
| `tests/` | `unit/`, `integration/`, `analyzer/`, `code_lanes/`, `fixtures/` (below) |
| `examples/` | runnable integration examples (`claude_agent_loop.py`, `ledger_run.py`, `log_conversation.py`, `onboarding_walkthrough.py`), and the course starter a teacher copies into a repository of their own (`course-starter/`, [teaching](../guides/teaching.md#hand-out-the-labs-as-an-assignment)) |
| `i18n/` | machine translations of the README, the quickstart and the use-case pages, one folder per language in `LANGUAGES`; generated by `scripts/i18n/translate.py` (`.github/workflows/i18n.yml`), never edited by hand |
From 92d357679170b4dee576efa71fbef34bbe358afc Mon Sep 17 00:00:00 2001
From: Shaun Struwig <41984034+Blargian@users.noreply.github.com>
Date: Tue, 24 Nov 2026 18:54:58 +0100
Subject: [PATCH 09/16] Render procedure docs with Steps
Numbered procedure headings bypassed the site component and did not share its visual treatment.
Signed-off-by: Shaun Struwig <41984034+Blargian@users.noreply.github.com>
---
.claude/rules/workers.md | 2 +-
README.md | 2 +-
docs/benchmarks/methodology.md | 2 +-
docs/benchmarks/running.md | 16 ++++++--
docs/development/adding-a-table.md | 20 ++++++++--
docs/development/adding-a-worker.md | 32 ++++++++++++----
docs/development/adding-an-operation.md | 36 +++++++++++++-----
docs/development/adding-language-support.md | 24 +++++++++---
docs/development/extending-loom.md | 2 +-
.../integrations/agent-instructions.md | 2 +-
docs/features/integrations/agent-substrate.md | 22 ++++++++---
docs/getting-started/agent-setup.md | 22 ++++++++---
.../getting-started/connect-a-coding-agent.md | 2 +-
docs/getting-started/evaluate.md | 20 +++++++---
docs/getting-started/first-agent.md | 38 +++++++++++++++----
docs/getting-started/quickstart.md | 38 ++++++++++++++-----
docs/guides/agent-integration.md | 32 ++++++++++++----
docs/guides/debugging.md | 24 ++++++++++--
docs/guides/headless-bots.md | 26 ++++++++++---
docs/guides/importing-clickgap-memory.md | 20 ++++++++--
docs/guides/optimize-namespace.md | 28 +++++++++++---
docs/guides/query-from-postgres.md | 24 +++++++++---
docs/index.md | 32 +++++++++++++---
docs/operations/deployment.md | 2 +-
docs/operations/troubleshooting.md | 2 +-
docs/scripts/prepare-content.mjs | 37 +++++++++++++++++-
docs/theme.css | 14 +++++++
docs/use-cases/agent-memory.md | 2 +-
28 files changed, 414 insertions(+), 109 deletions(-)
diff --git a/.claude/rules/workers.md b/.claude/rules/workers.md
index 5688b42a39..2d7d6af341 100644
--- a/.claude/rules/workers.md
+++ b/.claude/rules/workers.md
@@ -11,5 +11,5 @@ paths:
- A pass that reaches ClickHouse retries a transient failure within its pass budget rather than waiting for the next interval.
- A worker whose written orgs come only from a log table (`LOG_TABLES` in `server/cli/cell_scan.py`) writes a log table too: its table joins `LOG_TABLES`, so the first attach never places an org a caller only typed.
- An intended change to the enabled set, order, cadence or deadline updates the snapshot: `LOOM_UPDATE_WORKER_SNAPSHOT=1 .venv/bin/python -m pytest tests/unit/test_worker_registry_snapshot.py`.
-- Two copies can briefly overlap (a lease handover, an `on` process, two colours during a deploy): a pass is harmless when it runs twice at once — idempotent writes, leased claims, cursors in the store ([where it runs](../../docs/development/adding-a-worker.md#5-understand-where-it-runs)).
+- Two copies can briefly overlap (a lease handover, an `on` process, two colours during a deploy): a pass is harmless when it runs twice at once — idempotent writes, leased claims, cursors in the store ([where it runs](../../docs/development/adding-a-worker.md)).
- Guide: [adding-a-worker](../../docs/development/adding-a-worker.md).
diff --git a/README.md b/README.md
index 6e69f4bdbf..a1611489ba 100644
--- a/README.md
+++ b/README.md
@@ -139,7 +139,7 @@ Results are specific to the tested workloads.
Both modes support the same Loom features, including configured LLMs and embeddings.
Single-user is not a reduced-feature edition. You can also
-[switch an existing installation without deleting its data](./docs/getting-started/quickstart.md#2-open-the-dashboard);
+[switch an existing installation without deleting its data](./docs/getting-started/quickstart.md);
grant new accounts access to the existing namespaces.
To try it with nothing installed, open it in a codespace:
diff --git a/docs/benchmarks/methodology.md b/docs/benchmarks/methodology.md
index 0e0708fc62..acccee6212 100644
--- a/docs/benchmarks/methodology.md
+++ b/docs/benchmarks/methodology.md
@@ -262,7 +262,7 @@ key-less provider makes `/v1/health` report `degraded` before you spend a run.
| Evaluation reads | `measurement_fields()` sends `auto_touch: false` / `reinforce: false`; `--credit` opts in; on a namespace read before, pass `reinforcement_weight: 0` or use fresh rows |
| Fresh namespaces | One throwaway namespace per item or conversation, erased at the end |
| Warm-up | `search_latency.py --warm 1` discards the first call per query, so embedding-cache misses do not count as retrieval |
-| Token lifetime | Mint a token that outlives the run ([running](./running.md#2-mint-a-token-that-outlives-the-run)) |
+| Token lifetime | Mint a token that outlives the run ([running](./running.md)) |
### Bench namespaces
diff --git a/docs/benchmarks/running.md b/docs/benchmarks/running.md
index 7680141a64..f090bac16a 100644
--- a/docs/benchmarks/running.md
+++ b/docs/benchmarks/running.md
@@ -12,7 +12,9 @@ virtualenv on the path, the harness silently runs that checkout's code. The `mak
targets set `PYTHONPATH` this way (`BENCH_PYTHON` in the `Makefile`), and the commands
below assume it is exported. `python bench/.py --help` lists a harness's flags.
-## 1. Prepare a server with real providers
+
+
+
A bench on fake providers measures nothing
([why](./methodology.md#fake-providers-make-scores-meaningless)). The stock `.env` pins
@@ -41,7 +43,9 @@ a shared one: its queue depth is part of what they measure. No harness records h
For latency numbers, write down the host, the ClickHouse deployment (OSS single node or
Cloud) and `build_commit` yourself.
-## 2. Mint a token that outlives the run
+
+
+
A token that expires mid-run turns later calls into errors, which show up as 429s on the
shared limiter rather than a clear failure. Long runs take hours, so mint with days of
@@ -68,7 +72,9 @@ Judged benches also need `OPENAI_API_KEY` in the bench process for the pinned re
judge. `OPENAI_BASE_URL` points them at a compatible gateway; `BENCH_READER_MODEL` /
`BENCH_JUDGE_MODEL` override them and mark the run non-comparable.
-## 3. Run a target
+
+
+
### Offline (no server, no spend)
@@ -188,6 +194,10 @@ Every other harness is `python bench/.py --base-url … --token …` plus
flag. [`bench/README.md`](../../bench/README.md) lists them by area with a "when to run
what" table.
+
+
+
+
## Datasets
The repository commits only data written for it: one synthetic memory QA set, fixtures
diff --git a/docs/development/adding-a-table.md b/docs/development/adding-a-table.md
index d8af79bee1..d3846642d6 100644
--- a/docs/development/adding-a-table.md
+++ b/docs/development/adding-a-table.md
@@ -14,7 +14,9 @@ flowchart TD
H -->|yes| I["row builders + memory_versions mirror"]
```
-## 1. Write the migration and regenerate the schema
+
+
+
[Migrations](migrations.md) owns the rules: numbering, what counts as additive, runner directives, sort-key rebuilds, and `make schema-dump` / `make schema-check` against the pinned ClickHouse. In short:
@@ -25,7 +27,9 @@ flowchart TD
Until a deployment applies the migration, the client's schema guard refuses a read or write naming a table a pending migration would create, with `SCHEMA_PENDING`.
-## 2. Mirror every column on ReplacingMergeTree write paths
+
+
+
`loom.memory`, `loom.shared` and `loom.memory_embeddings` are `ReplacingMergeTree(version)` tables read with `FINAL`. Every handler that writes a new version row (set, tombstone, restore, touch, `update_by_id`, `bulk_set`, promote, demote) carries **every** persisted column forward. A column omitted on a later version row reads as zero under `FINAL`.
@@ -44,7 +48,9 @@ When you add a column to one of these tables:
Any new write path sets the server-stamped `actor` and `source_class` (`server.memory.domain.provenance`), never values from the request body.
-## 3. Classify the table for erasure
+
+
+
Erasure is a saga (`server/erasure/app/saga.py`). Its last step is a residue census over every table the read paths touch; any live row in scope fails the saga closed. `tests/unit/test_every_table_is_classified.py` fails for any `CREATE TABLE` in `schema.sql` that is not in exactly one of three lists in `server/erasure/store/census.py`:
@@ -72,12 +78,18 @@ For a `_CENSUS` table:
Test the step's statement shape with a stub client, as `tests/unit/test_erasure_repo.py` and
`tests/unit/test_erasure_late_steps.py` do.
-## 4. Classify any mutation
+
+
+
An `ALTER TABLE loom. UPDATE|DELETE` is a ClickHouse mutation: it rewrites parts asynchronously and is not transactional. `tests/unit/test_clickhouse_mutation_inventory.py` counts every visible one under `server/` against `_EXPECTED_MUTATIONS`. A new one fails until you add it there with a comment saying why.
Prefer a new version row on a `ReplacingMergeTree`, a tombstone column, or a lightweight `DELETE FROM`. Never use a mutation as a claim or lock a request waits on; the task inbox claims through a `KeeperMap` lease table instead.
+
+
+
+
## Checklist
- [ ] New `schemas/migrations/_.sql`, additive, idempotent; no merged file edited.
diff --git a/docs/development/adding-a-worker.md b/docs/development/adding-a-worker.md
index caf48d881a..9b5e46a794 100644
--- a/docs/development/adding-a-worker.md
+++ b/docs/development/adding-a-worker.md
@@ -12,7 +12,9 @@ flowchart LR
V --> W["loom.worker_status /v1/admin/workers.status"]
```
-## 1. Write the pass
+
+
+
Create `server//workers/.py` with an `async def run_pass()`. The supervisor calls it once per interval and discards the return value. A small example is `server/tasks/workers/lease_sweep.py`:
@@ -45,7 +47,9 @@ The pass contract:
- **Cursor.** A paging worker reads `pass_context.resume_cursor()` and calls `pass_context.set_cursor(value)` where it stopped. The cursor is stored on the pass's `loom.worker_status` row, so a restarted process resumes.
- **A broad `except` says why:** `# noqa: BLE001 — `.
-## 2. Attribute its queries
+
+
+
The supervisor tags every pass:
@@ -62,7 +66,9 @@ from server.core.ch import set_query_tag
set_query_tag("worker.my_loop")
```
-## 3. Add its settings
+
+
+
Add the switch and the cadence to the area's section of `server/settings/catalog.py` (`Memory`, `Code`, `Tracker`, …). Each comment becomes the row's text in the generated [configuration reference](../reference/configuration.md).
@@ -78,7 +84,9 @@ Add the switch and the cadence to the area's section of `server/settings/catalog
Default a worker **off** when it needs credentials, spends on a provider, or serves a plane an operator opts into. Default-on workers run on every stack, including a laptop.
-## 4. Add the registry row
+
+
+
```python
(
@@ -118,7 +126,9 @@ def due_scope() -> list[tuple[str, str]]: ... # the (org, namespace) pairs this
That is `server/tracker/workers/embed.py`'s declaration. The check is one statement per table, bounded by `FIRST_PASS_DUE_TIMEOUT_SECONDS`. An unreadable table reads as due.
-## 5. Understand where it runs
+
+
+
**One supervisor per deployment.** `server/workers/leader.py` elects one process across every container and host through ClickHouse: the `workers_supervisor` key in the Keeper lock table `loom._migration_lock`. The holder renews every `LOOM_SUPERVISOR_LEASE_TTL_S / 6`; a holder that loses the lease stops its workers; when the holder dies, another process takes over after `LOOM_SUPERVISOR_LEASE_TTL_S` (default 30 s).
@@ -136,7 +146,9 @@ Run every replica in `auto`: any of them may become the leader. A `make server`
**Rolling upgrades.** An older build leaves the lease to a live newer build (see [Failure and recovery](../architecture/failure-and-recovery.md#background-workers)). The old leader releases the lease when it stops, and a newer process takes it on its next round, within seconds.
-## 6. Pin it in tests
+
+
+
- **Registry snapshot.** `tests/unit/test_worker_registry_snapshot.py` builds the worker list under three settings profiles (`defaults`, `all_on`, `production`) and compares every `WorkerSpec` field with `tests/unit/snapshots/worker_registry.json`. Regenerate it for an intended change only:
@@ -151,12 +163,18 @@ Run every replica in `auto`: any of them may become the leader. A `make server`
- **Generated docs.** `python scripts/codegen/docs_reference.py` regenerates the
[workers reference](../reference/workers.md); `make lint` fails while it is stale.
-## 7. Check it runs
+
+
+
- `/v1/admin/workers.status` merges this process's registry with the latest `loom.worker_status` row per worker, so the web tier shows workers running in the workers container.
- `/v1/health?include=workers` reports per-worker status and `workers_leader`: whether the answering process holds the lock, and why.
- Alert on `loom.worker.consecutive_failures{worker}` and `loom.worker.partial_failures{worker}` ([monitoring](../operations/monitoring.md)).
+
+
+
+
## Related
- [Extending Loom](extending-loom.md)
diff --git a/docs/development/adding-an-operation.md b/docs/development/adding-an-operation.md
index c2639c6bcc..933a0b36d5 100644
--- a/docs/development/adding-an-operation.md
+++ b/docs/development/adding-an-operation.md
@@ -14,7 +14,9 @@ flowchart LR
The example is `calibration.get`, one of the smallest ops: `server/memory/api/models_calibration.py`, `server/memory/api/ops_calibration.py` and `server/memory/app/calibration.py`.
-## 1. Define the input and output models
+
+
+
Put them in the group's models module, `server//api/models_.py`. A models module holds Pydantic wire models only: it imports no handler.
@@ -43,7 +45,9 @@ Rules for the models:
- **No model-level "one of A or B" validators** on read inputs. The transport validates the body before authorization, so a raising `@model_validator` describes the op to a principal the namespace gate would refuse. Put the rule in the handler and raise `server.core.errors.ValidationError`. `tests/unit/test_op_inputs_after_gate.py` checks every registered op.
- **To retire a field**, delete it. A client that still sends it is served, with the field named in `ignored_args` ([unknown and removed fields](../reference/http-api.md#unknown-and-removed-fields)).
-## 2. Write the handler
+
+
+
One handler module per group, under `server//app/`. A handler is `async`, takes the input model and returns the output model. It imports the wire models at module top; the models never import a handler, so the import is acyclic:
@@ -64,7 +68,7 @@ async def handle_calibration_get(input: CalibrationGetInput) -> CalibrationGetOu
- The transport tags ClickHouse queries with `log_comment`; a handler does nothing.
- Read settings as `settings.`, never `getattr(settings, ...)`.
- If the op writes `loom.memory` or `loom.shared`, build rows with the builders in
- `server/memory/store/rows.py` ([adding a table](adding-a-table.md#2-mirror-every-column-on-replacingmergetree-write-paths)).
+ `server/memory/store/rows.py` ([adding a table](adding-a-table.md)).
### Ops addressed by an org-wide id
@@ -84,7 +88,9 @@ if row is None:
Answer as for a missing row, never 403: a 403 confirms the id exists in another tenant. Pass `Role.WRITER` and `strong=True` to `namespace_for_id` for a write, so the holders are read current. An op that must read the row first, such as `memory.redact`, checks it with `authz.row_in_scope` after the fetch ([row-scoped operations](../architecture/security.md#row-scoped-operations)).
-## 3. Declare the operation
+
+
+
```python
from server.operations.base import Operation, Role
@@ -116,14 +122,16 @@ The declaration lives in the group's ops module, `server//api/ops_
+
+
`server/operations/toolsets.py` decides where the op is listed:
@@ -134,7 +142,9 @@ The op is **read-only** (MCP `readOnlyHint`, the `readonly` toolset) exactly whe
A listed op needs its description in `server/transport/mcp_descriptions.py`
(`TOOL_DESCRIPTIONS`). Write it for the model: when to call the tool, what it returns, what not to use it for. A description about a changed fact interpolates `revision_policy()` from the same module instead of stating its own. Name another op by its dotted op name; each listing renames a listed op to its tool and marks an unlisted one ([MCP reference](../reference/mcp.md#tool-list)). Never write an op as a call (`op(args)`), inside a longer code span, or with a hand-written "(via loom_op)". An op name given as a field's example value goes in single quotes (`'memory.ask'`), which the listing leaves as written.
-## 5. Check reach and maturity
+
+
+
An op's **reach** is derived (`Operation.reach`, `server/operations/reach.py`): its MCP roster membership plus a committed scan of the SDKs, `examples/`, `dev/` and `scripts/`, the plugin hooks, and the dashboard's `"/v1/"` call sites. `{"http_only"}` means only a raw `/v1/*` POST reaches it.
@@ -144,7 +154,9 @@ Every op is on every surface or says why not in code. HTTP serves every op in th
- A `stable` op is [listed under the MCP `all` toolset](../reference/operations.md#mcp-all-listing), or, if hidden from MCP, has another reach path, and is meant to have production callers; `python scripts/codegen/op_reach_census.py --call-counts --days 30` shows whether it has them. Declare a new op `experimental` unless it replaces a stable one.
- Refresh the manifest: `python scripts/codegen/op_reach_census.py --write-manifest` (writes `server/operations/reach_manifest.py`).
-## 6. Write the tests
+
+
+
| Test | What it asks of your op |
| -------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
@@ -157,7 +169,9 @@ Every op is on every surface or says why not in code. HTTP serves every op in th
If the leakage suite cannot synthesize a body for your op, it reports it; add a hint instead of skipping. An op that mutates the caller's own namespace goes in the suite's `_SKIP_OPS`, with the writer gate covered elsewhere. Integration tests need a running server (`LOOM_BASE_URL`) and skip without one. Mint tokens with the suite's helpers, not self-signup, which CI does not enable.
-## 7. Regenerate and run the gates
+
+
+
```bash
python scripts/codegen/sdk_py_gen.py # sdk/python/loom/ops.py
@@ -178,6 +192,10 @@ CI fails when a generated file is stale. The generated SDK files give every clie
`python scripts/codegen/wire_changelog.py ` prints what changed for clients between two revisions. The release notes are built from it.
+
+
+
+
## Before you open the PR
- [ ] Models, handler, declaration, `OPERATIONS` entry (and `_OPERATION_MODULES` for a new group).
diff --git a/docs/development/adding-language-support.md b/docs/development/adding-language-support.md
index ec1c13b9b1..52e63ffbe6 100644
--- a/docs/development/adding-language-support.md
+++ b/docs/development/adding-language-support.md
@@ -31,7 +31,9 @@ Languages `lang_for_path` does not name are detected in `lang_detect.py`, so add
Every module under `server/code/domain/extract/` is either in a stage of `STAGE_MODULES` or named, with a reason, in `NON_EXTRACTOR_MODULES` in `tests/unit/test_code_extractor_stamp.py`. Put a new lane module in `NON_EXTRACTOR_MODULES`, or that test fails.
-## 1. Choose the lane's shape
+
+
+
| Shape | Examples | You provide |
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
@@ -43,7 +45,9 @@ Every module under `server/code/domain/extract/` is either in a stage of `STAGE_
A grammar lane's grammar is **not** in `STAMPED_GRAMMARS`, so upgrading it moves no stamp. The lane owns re-deriving its rows.
-## 2. Write the parser
+
+
+
`parse_(path: str, source: bytes) -> ParsedFile` returns the language tag, the symbols (`treesitter.Symbol`: qualified name, kind, span, signature), the includes and what the edge stage needs. Follow the nearest existing lane:
@@ -71,7 +75,9 @@ _PARSERS = {
and add the extension to `LANG_BY_EXTENSION` (`".rs": "rust"`). The wrapper imports the lane lazily, so an optional grammar stays optional. A new tree-sitter grammar also goes in `bounded_parse._LOADERS`, which every parse runs through first.
-## 3. Test the lane
+
+
+
- **A lane test**, `tests/unit/test_code_lang_.py`, parses small inline sources and asserts names, kinds, spans, includes and edges. Skip when the grammar is absent: `pytest.importorskip("tree_sitter_rust")`. `test_code_lang_rust.py` and `test_code_lang_typescript.py` are the models.
- **The lanes corpus.** Add fixtures under `tests/fixtures/code_lanes//`: synthetic, or open-source excerpts under their own licence, listed in `tests/fixtures/code_lanes/NOTICE.md`. `tests/unit/test_code_lanes_corpus.py` derives languages, symbols, facets, includes and edges from every fixture and compares them with `tests/fixtures/code_lanes/expected.json`. Regenerate and review the diff:
@@ -88,7 +94,9 @@ and add the extension to `LANG_BY_EXTENSION` (`".rs": "rust"`). The wrapper impo
`NON_EXTRACTOR_MODULES`.
- **Retrieval.** For a lane that should answer `code.search` or `code.symbol` well, run the code-intelligence gate before and after. `make bench-code-intel-dry` checks the question set offline; `make bench-code-intel` runs it against a server with a real embedder, never the fake one ([running benchmarks](../benchmarks/running.md)).
-## 4. Bring existing namespaces up to date
+
+
+
A lane outside the stamp changes nothing already indexed. New commits use the lane; old files keep their previous rows (often chunk-only). Re-derive them with a targeted backfill:
@@ -101,7 +109,9 @@ loom code backfill --org --namespace --paths-file rust-pa
> **Warning:** if a change must touch a stamped module (a `chunker.py` fix, a `treesitter.py` extension), say so in the PR. Every deployment that takes it re-derives the moved stages for every file of the affected families in every namespace. A `chunker.py` change moves only `chunk`; an `edges_treesitter.py` change moves `edge`, `chunk` and `guard`; a parser change moves every stage.
-## 5. Add a compiler tier (optional)
+
+
+
A compiler tier pays off when fast-tier edges are ambiguous (overloads, dynamic dispatch, re-exports) and a SCIP indexer exists. `TIERS` in `server/code/domain/index/compiler_tiers.py` lists the tiers. Each `TierSpec` names the indexer (`scip-clang`, `scip-typescript`, `scip-go`, `scip-python`), its `code_index_state` watermark key (`scip_commit`, `scip_commit_ts`, `scip_commit_go`, `scip_commit_py`) and the workers that move it. A new tier needs:
@@ -121,6 +131,10 @@ A compiler tier pays off when fast-tier edges are ambiguous (overloads, dynamic
Compiler-tier rows carry `tier='scip'`. Reads merge them with the fast tier by qualified name, preferring the compiler tier. Files the indexer skips, and commits before their delta lands, still read from the fast tier.
+
+
+
+
## Related
- [Code index overview](../features/code-index/overview.md)
diff --git a/docs/development/extending-loom.md b/docs/development/extending-loom.md
index 73da8dff0c..636430b89e 100644
--- a/docs/development/extending-loom.md
+++ b/docs/development/extending-loom.md
@@ -44,7 +44,7 @@ flowchart LR
- **The code is the registry.** Transports iterate `ALL_OPERATIONS`, the supervisor iterates `_WORKERS`, and the settings reference is generated from `server/settings/`. Each registry has a snapshot or census test that fails until you regenerate it.
- **Generated files.** `make lint` runs every generator with `--check`: the SDK op tables (`scripts/codegen/sdk_py_gen.py`, `sdk_ts_gen.py`), the reach manifest (`op_reach_census.py`), the reference pages (`docs_reference.py`, `settings_reference.py`) and the Codex plugin copies (`agent_plugin_sync.py`). See [code generation](code-generation.md).
-- **Maturity.** A new op declares `maturity="experimental"` unless it replaces a stable one ([adding an operation](adding-an-operation.md#5-check-reach-and-maturity)).
+- **Maturity.** A new op declares `maturity="experimental"` unless it replaces a stable one ([adding an operation](adding-an-operation.md)).
- **Measurement.** A change to ranking, extraction or a provider default runs the relevant bench before and after ([performance tuning](../guides/performance-tuning.md#measure-first)).
- **Foundational shapes are not extension points.** The engine (ClickHouse), the identity tuple, per-row content-hash audit and the five belief-revision operations change only with a design rationale in the PR and in the architecture docs ([system overview](../architecture/system-overview.md)).
diff --git a/docs/features/integrations/agent-instructions.md b/docs/features/integrations/agent-instructions.md
index 66910fd5b5..33a5dd40f3 100644
--- a/docs/features/integrations/agent-instructions.md
+++ b/docs/features/integrations/agent-instructions.md
@@ -147,7 +147,7 @@ Each line is the short form of what the plugins teach, or of what Loom's answers
The block's last memory line stands for the end-of-task review; to spell it out, copy
its questions from the [agent-integration
-guide](../../guides/agent-integration.md#7-follow-the-memory-skills-review) under the
+guide](../../guides/agent-integration.md) under the
block. The skills carry the detail the block leaves out: the receipt fields, documents
versus memories, the stop rules. The `loom` and `loom-code` skills can be installed
beside the block for that detail ([coding agents](index.md#coding-agents)); `loom`
diff --git a/docs/features/integrations/agent-substrate.md b/docs/features/integrations/agent-substrate.md
index 3054a7336b..1a76a17f26 100644
--- a/docs/features/integrations/agent-substrate.md
+++ b/docs/features/integrations/agent-substrate.md
@@ -26,7 +26,9 @@ connections from the gateway pods, not from the actors. Each row records the tok
subject, which tells the actors apart; the row's `agent` is the MCP client's name, which
actors running the same client share.
-## 1. Install Loom in the cluster
+
+
+
Install the chart as [Kubernetes](../../operations/kubernetes.md) describes, in namespace
`loom` with release name `loom`, which names the Service `loom`. The agents need no
@@ -49,7 +51,9 @@ networkPolicy:
app: atenet-egress
```
-## 2. A token per agent
+
+
+
Give each agent its own token, with a service-account subject named for the atespace and
the Substrate actor. Loom records that subject on each row the agent writes, and the token's
@@ -105,7 +109,9 @@ kubectl -n loom-tokens-research create secret generic research-agent \
--from-literal=token="$TOKEN" --dry-run=client -o yaml | kubectl apply -f -
```
-## 3. Configure the agent and create its actor
+
+
+
Substrate's documentation describes no MCP configuration for actors: configure the agent's
MCP client in its image or as literal environment values in the actor template. The server
@@ -139,7 +145,9 @@ kubectl ate create actor-template -f template.yaml
kubectl ate create actor research-agent --template=research-agent -a research
```
-## 4. Allow the actor to reach Loom, with its token
+
+
+
An actor has one egress policy. This one, for the actor created above, allows HTTP to
Loom's Service and replaces the `Authorization` header the agent sends with
@@ -188,6 +196,10 @@ With the policy in place, start the actor:
kubectl ate resume actor research-agent -a research
```
+
+
+
+
## Several agents
- Agents in one Loom namespace share everything they write. A sub-agent that should read
@@ -195,7 +207,7 @@ kubectl ate resume actor research-agent -a research
(`--namespace-role team=viewer --namespace-role research=writer`;
[mint a token](../../guides/tokens-and-grants.md#mint-a-token)).
- Each actor gets its own token, Secret and egress policy; an actor in another atespace gets
- that atespace's own token namespace and grant ([step 2](#2-a-token-per-agent)).
+ that atespace's own token namespace and grant.
- Hand work between agents with the [task inbox](../tasks-and-decisions.md#task-inbox).
## Related
diff --git a/docs/getting-started/agent-setup.md b/docs/getting-started/agent-setup.md
index eb3a5968c0..77b3b590ba 100644
--- a/docs/getting-started/agent-setup.md
+++ b/docs/getting-started/agent-setup.md
@@ -44,7 +44,9 @@ This copy names no release, so its commands do not run as they are. Follow the
what a check expects, or report `PASS` for a step that did not run. A `FAIL` line is a
correct report.
-## 1. Install the release
+
+
+
```sh
mkdir -p ~/loom-agent-setup
@@ -55,10 +57,12 @@ curl -fsSL "https://github.com/ClickHouse/loom/releases/download/v/inst
The installer verifies the bundle's SHA-256, installs under `~/.loom`, starts the stack
and waits for the server's `/v1/health`. If the command fails, the report is its `install`
-line alone; do not go on. The [quickstart](quickstart.md#1-boot-the-stack) says what the
+line alone; do not go on. The [quickstart](quickstart.md) says what the
installer does in full.
-## 2. Install the plugin
+
+
+
The plugin comes from the same release's source, so it matches the server:
@@ -86,7 +90,9 @@ with no token. **The person** now starts a new session of the agent (Codex: an i
`codex` run, where they also approve the plugin's hooks), gives it this text again and
says "continue at step 3". Steps 3 and 4 run in that session.
-## 3. Run the check
+
+
+
Save this script as `loom-setup-check.py` and run `python3 loom-setup-check.py`. It uses
only the Python standard library and talks to Loom over HTTP. It writes into the namespace
@@ -237,7 +243,9 @@ What each check must see:
When `server` fails, the script writes nothing and runs no other check.
-## 4. Check the agent's connection
+
+
+
Call your `loom_search` tool once, with the query `agent setup check`, and run
`claude plugin list` (or `codex plugin list`). The line is
@@ -245,6 +253,10 @@ Call your `loom_search` tool once, with the query `agent setup check`, and run
shows `loom@loom` enabled, otherwise
`[FAIL] agent `.
+
+
+
+
## Report
Give the script's lines, then the `agent` line, then one summary that counts the `agent`
diff --git a/docs/getting-started/connect-a-coding-agent.md b/docs/getting-started/connect-a-coding-agent.md
index 39efbf5b5b..623d2974a3 100644
--- a/docs/getting-started/connect-a-coding-agent.md
+++ b/docs/getting-started/connect-a-coding-agent.md
@@ -126,7 +126,7 @@ with `loom install`) so the tools the block names are listed.
## Share a team namespace with separate credentials
-Use an [authenticated multi-user deployment](quickstart.md#2-open-the-dashboard)
+Use an [authenticated multi-user deployment](quickstart.md)
with TLS for remote clients. Single-user mode does not enforce team access boundaries.
The server must support create-if-absent memory writes through
`if_match_sha256: "absent"`, and its session-protection policy must admit the write.
diff --git a/docs/getting-started/evaluate.md b/docs/getting-started/evaluate.md
index 061ab54196..25d863e8e3 100644
--- a/docs/getting-started/evaluate.md
+++ b/docs/getting-started/evaluate.md
@@ -43,14 +43,16 @@ Pre-registering the gates prevents a convenient metric or slice from becoming th
after the run. Keep failures and abstentions visible; report request errors separately
instead of silently counting or discarding them as retrieval misses.
-## 1. Product smoke test
+
+
+
This takes about 15 minutes and proves wiring, persistence and visibility—not semantic
quality.
-1. [Boot the local stack](quickstart.md#1-boot-the-stack) and confirm `/v1/health` reports
+1. [Boot the local stack](quickstart.md) and confirm `/v1/health` reports
`status: ok`.
-2. [Write and search a fact](quickstart.md#4-first-memory-over-http).
+2. [Write and search a fact](quickstart.md).
3. [Connect a coding agent](connect-a-coding-agent.md), tell it a durable preference, open
a fresh session and ask for that preference.
4. Correct the fact, then confirm the dashboard shows its source and version history.
@@ -62,7 +64,9 @@ answer, an unrelated question abstains, and the dashboard shows the writer and h
The result says nothing about production recall while health reports `fake_embedding` or
`fake_llm`.
-## 2. Evaluate your workload
+
+
+
Configure [real providers](../operations/deployment.md#providers), reset or re-embed data
if the vector width changed, and record the resolved models from `/v1/health`. Use an
@@ -233,7 +237,9 @@ it defers MCP tool definitions.
slice to a general claim.
- Save per-question outputs, including errors and misses—not only aggregate scores.
-## 3. Audit or reproduce published results
+
+
+
The README is a scorecard, not the evidence ledger. For every published number:
@@ -249,6 +255,10 @@ license are listed under [datasets](../benchmarks/running.md#datasets). Full pub
can take hours and incur provider charges; start with the documented smoke slice, then run
the complete protocol before publishing a comparison.
+
+
+
+
## What to publish
Publish a result in the README only when it is representative, understandable in one row,
diff --git a/docs/getting-started/first-agent.md b/docs/getting-started/first-agent.md
index 14e5d0a9cc..a1d4b7c989 100644
--- a/docs/getting-started/first-agent.md
+++ b/docs/getting-started/first-agent.md
@@ -8,13 +8,15 @@ seo:
This tutorial builds a small agent with the Python SDK. It continues from the
[quickstart](./quickstart.md): the stack runs on `http://localhost:7777` and the Python
-SDK is installed ([quickstart step 5](./quickstart.md#5-first-memory-from-python)). Every
+SDK is installed ([quickstart step 5](./quickstart.md)). Every
step runs on the stock stack. Meaningful extraction and grounded `memory.ask` answers
need a configured real LLM; ranking is meaningful on the released stack's local embedder,
not on a checkout's fake one
([providers](../operations/deployment.md#providers)).
-## 1. Give the agent an identity
+
+
+
Every row Loom stores carries the identity tuple `(org, namespace, agent, user_id,
session_id)`. The `Agent` binds the first three; `user_id` and `session_id` travel per
@@ -55,7 +57,9 @@ facts, and one namespace shared by several agents must still say who wrote what.
[identities and namespaces](../concepts/identities-and-namespaces.md) page explains the
model.
-## 2. Store facts and handle abstain
+
+
+
```python
async def remember_and_recall(a: Agent) -> None:
@@ -102,7 +106,9 @@ does the user prefer?", user_id=USER)` returns `answer`, `abstain` and the `memo
it cited. Grounded answers need a configured real LLM; the fake one can return
deterministic output for development and tests.
-## 3. Hold a conversation as a session
+
+
+
A `Session` is what an agent loop keeps between turns and across restarts. It binds one
`(user_id, session_id)` scope and four verbs to it:
@@ -138,7 +144,9 @@ SDK logs a warning) and extraction still runs.
[Conversations and sessions](../features/conversations-and-sessions.md) covers threads,
digests and session briefs.
-## 4. Load context at session start
+
+
+
Outside a session, one call assembles the bounded block an agent wants before its first
turn: working memory first, then the profile, relevant memories, matching procedures and
@@ -159,7 +167,9 @@ instead of failing the pack. Working memory is scratchpad state, not retrieval m
is loaded first and never embedded or ranked
([Working memory and profiles](../features/memory/working-memory-and-profiles.md)).
-## 5. Record a task as a run
+
+
+
A run is one agent execution: what it was asked, what it relied on and how it ended.
Naming the memories a run relied on is the feedback loop: those keys are credited in
@@ -199,7 +209,9 @@ The same two calls are available directly as `a.run.begin(goal=...)` and
stored as a `reflection` memory. `a.run.get(run_id)` replays a run with what it wrote,
recalled and cost. [Runs](../features/runs.md) covers reflections, retention and grades.
-## 6. Put it together
+
+
+
```python
async def main() -> None:
@@ -218,6 +230,10 @@ agent, `/runs` for the run, and `/conversations` for the thread. Blocking code u
`loom.SyncAgent`, which takes the same arguments and exposes every method as a blocking
call.
+
+
+
+
## The same agent in TypeScript
The TypeScript SDK (`@clickhouse/loom`;
@@ -270,13 +286,19 @@ await bot.call(
`memory.ask`. The [TypeScript SDK reference](../reference/typescript-sdk.md) covers the
full surface.
-## 7. Connect a coding agent
+
+
+
A coding agent reads the same namespace through MCP tools. What you stored from Python
is visible to it when its token reads that namespace.
[Connect a coding agent](./connect-a-coding-agent.md) covers the plugins and
`loom install`.
+
+
+
+
## Next
- [Memory](../concepts/memory.md): what happens between the write and the read.
diff --git a/docs/getting-started/quickstart.md b/docs/getting-started/quickstart.md
index c534527d9e..d7b906187a 100644
--- a/docs/getting-started/quickstart.md
+++ b/docs/getting-started/quickstart.md
@@ -14,7 +14,9 @@ Run Loom locally with Docker. The default install listens only on localhost and
Use Docker Desktop or Docker Engine with Compose 2.20 or later. Leave port `7777` free
for Loom. On Windows, run the installer in a WSL 2 terminal where `docker` works.
-## 1. Boot the stack
+
+
+
### Fast path: released image, no clone
@@ -210,8 +212,8 @@ to localhost. Before sharing it with a team, configure [operator access](../oper
and [TLS](../operations/deployment.md#proxy-and-tls). Configure [real models and API keys](./models-and-keys.md)
as well; selecting multi-user mode does not replace the fake LLM.
-For an already running single-user stack, follow the [switching instructions](#2-open-the-dashboard)
-instead; container recreation preserves the existing data volumes.
+For an already running single-user stack, follow the switching instructions below instead;
+container recreation preserves the existing data volumes.
### Contributor path: build a checkout
@@ -319,7 +321,9 @@ docker compose --project-directory "$HOME/.loom" exec loom loom doctor
- `loom doctor` prints one line per server-side check. `--json` gives JSON. From a source
checkout stack, run `docker compose --env-file .env -f compose.yaml -f dev/docker-compose.dev.yml exec loom loom doctor`.
-## 2. Open the dashboard
+
+
+
`http://localhost:7777/` opens straight into the dashboard in `single-user` mode;
in multi-user mode, sign up or sign in first. In `single-user` mode
@@ -356,7 +360,9 @@ so anyone who reaches the port can then sign up. Before making the server reacha
team, follow the [deployment guide](../operations/deployment.md#identity-modes) for
operator access and [TLS](../operations/deployment.md#proxy-and-tls).
-## 3. Get a token
+
+
+
In single-user mode a token is optional. Minting one anyway keeps your scripts working
when auth is turned on, as long as they name their `org` (or send it blank), `namespace`
@@ -396,7 +402,9 @@ export LOOM_API_KEY=""
Claims, roles and grants are in [Tokens and grants](../guides/tokens-and-grants.md).
-## 4. First memory over HTTP
+
+
+
Every operation is a `POST /v1/` with a JSON body. A fresh install with the stock
`.env`, from the installer or a checkout, is single-user: no token, and an everyday memory
@@ -428,7 +436,9 @@ agent's memories in the namespace, including those added in the dashboard; name
`GET /v1/operations` lists every operation, and lets you try
each one from the browser. Shapes are in the [HTTP API reference](../reference/http-api.md).
-## 5. First memory from Python
+
+
+
```bash
pip install clickhouse-loom # or, from a clone: pip install ./sdk/python
@@ -484,7 +494,9 @@ The client surfaces are in the [Python SDK](../reference/python-sdk.md) and
[TypeScript SDK](../reference/typescript-sdk.md) references, and the
[Rust SDK usage](https://github.com/ClickHouse/loom/blob/main/sdk/rust/README.md#use).
-## 6. First memory from a coding agent
+
+
+
If the installer connected your agent, skip to the last paragraph of this section.
@@ -532,7 +544,9 @@ Start a new session and say _"Remember that I never deploy on Friday."_ The agen
`loom_search` and answers from the stored fact. The model decides when to save and
search from the tool descriptions; there are no trigger words.
-## 7. See it in the dashboard
+
+
+
| Page | Shows |
| ----------------- | ------------------------------------------------- |
@@ -542,6 +556,10 @@ search from the tool descriptions; there are no trigger words.
The rest is in [Dashboard](../features/dashboard.md).
+
+
+
+
## Optional: index a repository on the released stack
Adding a repository from the dashboard is refused on this stack with `SANDBOX_UNAVAILABLE`:
@@ -620,7 +638,7 @@ the answer and the chunks it cited. With the fake LLM it prints the top
| ----------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `set_from_messages` writes no facts | An empty result can be valid when the text contains nothing memorable. Check the provider configuration in [Models and keys](./models-and-keys.md); meaningful extraction needs a real LLM. |
| Search results look arbitrary | The embedder is a fake one (`fake-ngram-*` in `.env`). Switch it as [Models and keys](./models-and-keys.md) says, which re-embeds what is stored. Do not delete your volumes to change models. |
-| 401 `AUTH_INVALID` after turning auth on | No token, or one signed with another `LOOM_JWT_SECRET`. Re-mint with the Compose command in [Get a token](#3-get-a-token). |
+| 401 `AUTH_INVALID` after turning auth on | No token, or one signed with another `LOOM_JWT_SECRET`. Re-mint with the Compose command in the token step above. |
| The dashboard returns 503 | The server runs from source (`make server`) without a built frontend. Run `make frontend-build`. |
| Released stack does not become healthy | Run `docker compose --project-directory "$HOME/.loom" logs --tail 100 loom clickhouse`. See [Troubleshooting](../operations/troubleshooting.md). |
| Adding a repository answers `SANDBOX_UNAVAILABLE` | The stack runs without the repository-job sandbox. Index the repository through `LOOM_CODE_REPOS_JSON` ([Index a repository](#optional-index-a-repository-on-the-released-stack)). |
diff --git a/docs/guides/agent-integration.md b/docs/guides/agent-integration.md
index 1f08b50364..043a4486ff 100644
--- a/docs/guides/agent-integration.md
+++ b/docs/guides/agent-integration.md
@@ -20,7 +20,9 @@ system_prompt = "You triage support tickets.\n\n" + await agent.guide()
Over MCP the primer names the call; an Agent-Skills client installs it with
`npx skills add ClickHouse/loom --skill loom`.
-## 1. Choose the client surface
+
+
+
| Surface | Use it when | What you get |
| ------------------------------------------------------------ | ----------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
@@ -67,7 +69,9 @@ ID, outcome and latency, and confirm which evidence reached the model. SDK
Keep startup metadata, context retrieval, investigative lookups, checks and recording
separate when reporting tool adoption and cost.
-## 2. Choose the identity
+
+
+
Every row carries the identity tuple `(org, namespace, agent, user_id, session_id)`, plus
`run_id`. The token fixes `org` and the namespaces; the rest travels per call.
@@ -88,7 +92,9 @@ Every row carries the identity tuple `(org, namespace, agent, user_id, session_i
See [namespace access](tokens-and-grants.md#namespace-access).
- **No secret or personal identifier in `agent`:** it is stamped on every ledger row.
-## 3. Decide what to write
+
+
+
Pick the plane first. Durable memory is embedded, ranked, conflict-checked and versioned.
Working memory is read by key and never ranked. Knowledge holds chunked documents.
@@ -129,7 +135,9 @@ that works cases; [trace and resume](trace-and-resume.md) covers checkpoints.
A statement from the user ("we deploy Tuesdays") is the trigger to write. Do not search
first; the server handles duplicates and conflicts.
-## 4. Read the write's answer
+
+
+
A `memory.set` reply is a receipt. Read it:
@@ -144,7 +152,9 @@ A `memory.set` reply is a receipt. Read it:
Pass `if_match_sha256` (from a `memory.get`) when two writers may race on one key; a stale
hash is refused instead of overwriting.
-## 5. Read with one call per question
+
+
+
1. **Load context once per task.** `context.pack` returns a token-budgeted bundle: profile
sections, working memory, the memories relevant to `query`, procedures, and optionally
@@ -177,7 +187,9 @@ else:
reply = hits[0].content_excerpt
```
-## 6. Record runs
+
+
+
A run is one execution of a task: its goal, what it recalled and relied on, what it wrote and
its outcome. Recorded runs let ranking learn which memories help ([runs](../features/runs.md)).
@@ -199,7 +211,9 @@ An agent outside the plugins should also hand the finished transcript to
`memory.set_from_messages` (or close an `agent.session(...)`), so the server extracts what was
durable.
-## 7. Follow the memory skill's review
+
+
+
The plugins ship a `loom-memory` skill
(`integrations/claude-code-plugin/skills/loom-memory/`, generated into the Codex plugin)
@@ -224,6 +238,10 @@ skills cover code questions (`loom-code`, also at `skills/loom-code/` for any cl
reworking a namespace (`loom-optimize`), session restore (`loom-session`) and client health
(`loom-status`).
+
+
+
+
## Mistakes to avoid
`namespace.audit` detects each of these; [optimize a namespace](optimize-namespace.md) turns
diff --git a/docs/guides/debugging.md b/docs/guides/debugging.md
index bee14c366c..260fa80a9e 100644
--- a/docs/guides/debugging.md
+++ b/docs/guides/debugging.md
@@ -16,7 +16,9 @@ flowchart TD
G["memory.search explain=true per-component scores"] -.-> B
```
-## 1. Capture the request's ids
+
+
+
Every HTTP response carries:
@@ -38,7 +40,9 @@ curl -si "$LOOM_BASE_URL/v1/memory.search" -H "Authorization: Bearer $LOOM_API_K
points at the query. A large `app` with a small `ch` points at a provider call
(embedding, rerank, LLM).
-## 2. Join the request across systems
+
+
+
The same id is in `loom.agent_events.request_id`, the Langfuse trace metadata, and the
span attribute `loom.request_id` in `default.otel_traces`.
@@ -70,7 +74,9 @@ Spans go to `default.otel_traces` (in `LOOM_CLICKSTACK_DATABASE` when it is set)
> free-text argument with a `sha256:<16 hex>/` shape. To see what was asked, use
> the search trace log below or your own client log.
-## 3. Explain a search answer
+
+
+
**Why did this rank here?** `memory.search` with `explain=true` attaches `score_components`
to each served hit: the ranking signals and, after a reranker, its move (`rerank_from`,
@@ -116,6 +122,10 @@ per search: `returned_keys`, `returned_scores`, `abstain`, `retrieval_risk`,
`latency_ms`, and the `query` when `LOOM_LANGFUSE_CAPTURE_IO_LEVEL` is not `off` (its
default is `off`, so by default the rows carry keys and scores without the question).
+
+
+
+
## Diagnose coding-agent overhead
Separate three clocks: the agent's model requests, its tool and local work, and the
@@ -175,7 +185,9 @@ failed solutions, and keep setup and judging costs separate from coding costs.
Record whether source and lessons were present before attributing a bad patch to
retrieval. Successful delivery does not establish relevance or correct use.
-## 4. Explain a write
+
+
+
- **The write's own answer.** `memory.set` returns `status`, `conflict_verdict`, `peers`,
`duplicate_of`, `merged_into_key`, `noop` and `advisories`. A write that "disappeared"
@@ -195,6 +207,10 @@ retrieval. Successful delivery does not establish relevance or correct use.
- **A run's view.** `run.get(run_id)` returns what a run recalled (`recalled_keys`), what
it wrote, its turns and its cost ([trace and resume](trace-and-resume.md)).
+
+
+
+
## Related
- [Troubleshooting](../operations/troubleshooting.md)
diff --git a/docs/guides/headless-bots.md b/docs/guides/headless-bots.md
index 629759ccc1..96b0951e00 100644
--- a/docs/guides/headless-bots.md
+++ b/docs/guides/headless-bots.md
@@ -4,7 +4,9 @@ A headless bot runs with no person to paste a token, notice a silent failure or
"remember this". This guide covers the bot's identity, a connection check, three runtimes,
what the bot writes, and how to diagnose a bot that has gone quiet.
-## 1. Give the bot an identity
+
+
+
The `loom` CLI ships in the server image and installs from a clone with `pip install -e .`.
The SDK package (`clickhouse-loom`) has no CLI.
@@ -51,7 +53,9 @@ loom mint-token --subject ci-reviewer --org --namespaces agent-ci --roles
See [tokens and grants](tokens-and-grants.md) for roles, lifetimes and rotation.
-## 2. Check the connection before the first run
+
+
+
```bash
LOOM_BASE_URL=https:// LOOM_API_KEY="$(cat token.txt)" loom doctor --client
@@ -68,7 +72,9 @@ fix, and the exit code is non-zero, so the command works as a CI gate:
`--json` emits the checks and the problem list as JSON for a pipeline that parses them.
-## 3. Connect the runtime
+
+
+
### Claude Agent SDK or `claude -p`
@@ -151,15 +157,19 @@ async with Agent(org="acme", namespace="agent-nightly-triage", agent="nightly-tr
See the [Python SDK reference](../reference/python-sdk.md) and
[framework integrations](../features/integrations/frameworks.md).
-## 4. Decide what the bot writes
+
+
+
The plugins capture a coding session on their own. A bot outside them decides what to write.
In short: record decisions and failures, not transcripts; recall once before a task, not once
per step; hand a finished run's transcript to `memory.set_from_messages`; and report what the
run relied on with `run.complete(memories_used=[...])`.
-[Agent integration](agent-integration.md#3-decide-what-to-write) covers each choice.
+[Agent integration](agent-integration.md) covers each choice.
-## 5. When the bot is quiet
+
+
+
Run `loom doctor --client` on the bot's machine. It reports each of the usual causes on its
own line:
@@ -171,6 +181,10 @@ own line:
| 403 on every write | The token is a `viewer` on the namespace the bot writes to |
| Captures never appear | A background flusher never delivered them: stranded `loom-flush-*.json` files in the temp directory |
+
+
+
+
## Related
- [Tokens and grants](tokens-and-grants.md)
diff --git a/docs/guides/importing-clickgap-memory.md b/docs/guides/importing-clickgap-memory.md
index 5fff9080da..4ea00c48a9 100644
--- a/docs/guides/importing-clickgap-memory.md
+++ b/docs/guides/importing-clickgap-memory.md
@@ -34,7 +34,9 @@ Two commands do the work:
`version`. A re-import supersedes under `ReplacingMergeTree(version)` and the row count stays
the same.
-## 1. Dry-run
+
+
+
No writes. The dry run checks that every timestamp parses, prints the kind → type and TTL
crosstab and the category count, and probes the embedder so rows do not land unembedded.
@@ -47,7 +49,9 @@ loom import-clickgap \
Confirm the crosstab matches the source and that the embedder is reachable.
-## 2. Import
+
+
+
Use a **dedicated namespace** (`clickgap`) so rollback is a single `namespace.delete`. The
export carries no vectors, so every row is embedded on import with the live
@@ -74,6 +78,10 @@ analytics.
> **Warning:** `--seed-recall-events` is additive and not idempotent: run it once, into a
> fresh namespace. It **drops `pr_number`**, because Loom usage events have no PR column.
+
+
+
+
## Recall signal
The importer mirrors `recall_count` onto `memory_embeddings.reinforcement_count` and
@@ -89,7 +97,9 @@ reinforcement terms ([retrieval and ranking](../concepts/retrieval-and-ranking.m
workload depends on recall-frequency ordering, validate that the resulting order is
acceptable (the validator reports recall-order τ) before cutover.
-## 3. Validate before cutover
+
+
+
The validator mints its own admin token with `server.auth.jwt.mint_token`, so it needs
`LOOM_JWT_SECRET` and an explicit `LOOM_BASE_URL`: there is no default target. Its probes
@@ -126,6 +136,10 @@ Summaries (`summary → episodic`) are excluded from probes, since they are non-
design. `--seed` (default 42) makes the probe sample reproducible; `--concurrency`
(default 8) bounds concurrent searches.
+
+
+
+
## Use suppression memories
The `false_positive` lessons ("looks like a bug, do NOT re-raise") are the suppression
diff --git a/docs/guides/optimize-namespace.md b/docs/guides/optimize-namespace.md
index bcf139a5e9..c57d90c581 100644
--- a/docs/guides/optimize-namespace.md
+++ b/docs/guides/optimize-namespace.md
@@ -50,7 +50,9 @@ dry_run}`; a dry run adds `memory_type` and `value_preview`. After a move:
- `memory.get(from_key, follow=true)` serves the new row;
- `memory.search` and `memory.list` show only the new row.
-## 1. Audit
+
+
+
```bash
loom audit-namespace --org --namespace --window-days 7 --samples 5
@@ -78,7 +80,9 @@ The dashboard's namespace audit panel shows the same audit. `context.pack` carri
warnings among `exact_key_store`, `double_encoded_values`, `unembedded_rows` and
`coordination_as_memory`), so an agent sees it at session start.
-## 2. Plan
+
+
+
Write one section per finding. Only codes the audit returned get a section.
@@ -112,13 +116,17 @@ Store the plan as a knowledge document at `loom:////_optimize/plan-
+
+
The namespace owner approves in writing. A plan shown is not a plan approved. A partial
approval applies the named sections only. If the owner's writer is running (the audit's
`sets` in the window says so), tell them; the last hour of rows is out of scope either way.
-## 4. Apply
+
+
+
Back up first if the namespace matters: `memory.list … fields=["value"]` to a JSONL file,
`namespace.snapshot` (HTTP or SDK; it is not served over MCP), or on the server
@@ -145,13 +153,17 @@ curl -s "$LOOM_BASE_URL/v1/memory.move" -H "Authorization: Bearer $LOOM_API_KEY"
"dry_run": true}'
```
-## 5. Measure
+
+
+
Run the audit again over the same window and append a before/after table to the plan
document (`knowledge.upsert` on the same `source_uri`). Give the owner the
[writer rules](investigation-agent-memory.md#writer-rules).
-## 6. Retire nothing
+
+
+
Old keys stay readable through the redirect for as long as the owner wants. Once the writer
uses the new keys, the owner may tombstone the old ones with `memory.delete` (soft:
@@ -161,6 +173,10 @@ uses the new keys, the owner may tombstone the old ones with `memory.delete` (so
> answers `found: false`, a client may fall back to local state, and two stores then
> disagree. The redirect exists to prevent that.
+
+
+
+
## Related
- [Investigation agent memory](investigation-agent-memory.md): the target layout
diff --git a/docs/guides/query-from-postgres.md b/docs/guides/query-from-postgres.md
index c49542f7ff..61643cf0ed 100644
--- a/docs/guides/query-from-postgres.md
+++ b/docs/guides/query-from-postgres.md
@@ -17,7 +17,9 @@ extension. Use a separate database, or a separate service, from the one Loom's
CI tests the release `LOOM_PGCH_VERSION` names in `.github/workflows/ci.yml` on Postgres 16
and 18 (`tests/integration/test_pg_clickhouse_live_ch.py`).
-## 1. Make a SQL user for the tenant
+
+
+
On the Loom side, as an operator ([access](../reference/sql-surface.md#access)):
@@ -27,7 +29,9 @@ loom sql-access grant --user acme_bi --org acme --namespaces support,research
It prints the user's password once.
-## 2. Install the extension
+
+
+
The extension is in the `ghcr.io/clickhouse/pg_clickhouse:-`
images and on [PGXN](https://pgxn.org/dist/pg_clickhouse/), to build into a self-managed
@@ -56,7 +60,9 @@ As the owner:
CREATE ROLE app_reader LOGIN PASSWORD '';
```
-## 3. Point it at the ClickHouse service
+
+
+
```sql
CREATE SERVER loom_ch FOREIGN DATA WRAPPER clickhouse_fdw
@@ -89,7 +95,9 @@ These are the extension's defaults, written down so a later release's defaults c
one. A session that sets another setting fails in ClickHouse with `READONLY`: the SQL user's
profile refuses it ([access](../reference/sql-surface.md#access)), whatever the role says.
-## 4. Import the views
+
+
+
```sql
CREATE SCHEMA loom;
@@ -113,7 +121,9 @@ imported with, so to pick up new ones drop the schema (and any Postgres view bui
tables) and run the import and the grants again:
`DROP SCHEMA loom CASCADE; CREATE SCHEMA loom;`.
-## 5. Query and join
+
+
+
```sql
-- The facts Loom holds about each account on the support team
@@ -132,6 +142,10 @@ GROUP BY day ORDER BY day;
`value` is NULL where Loom withholds it; `value_withheld` says why.
+
+
+
+
## Cost and scale
- `EXPLAIN (VERBOSE)` shows which part of a query runs in ClickHouse. A join between a
diff --git a/docs/index.md b/docs/index.md
index 2f6a8c236e..1812692f8f 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -35,31 +35,45 @@ or [casos de uso en español](https://loom.clickhouse.com/docs/es/use-cases).
[Video demonstration of a cited answer](assets/screenshots/clip-assistant-answer.webm)
-## 1. Getting started
+
+
+
Check [what Loom includes](getting-started/whats-included.md), run the
[quickstart](getting-started/quickstart.md), and [configure models and API keys](getting-started/models-and-keys.md).
-## 2. Install and run the server
+
+
+
Choose a [deployment](operations/deployment.md), configure [single sign-on](operations/sso.md),
and use the [operations guides](operations/index.md) to run Loom day to day.
-## 3. Connect agents
+
+
+
[Connect a coding agent](getting-started/connect-a-coding-agent.md) or choose an
[integration](features/integrations/index.md) for your editor, MCP client, or framework.
-## 4. SDK and API
+
+
+
Find client libraries, commands, and wire contracts in the [reference](reference/index.md).
-## 5. Namespaces, access and the memory model
+
+
+
Read how Loom scopes [identities and namespaces](concepts/identities-and-namespaces.md),
stores [agent memory](concepts/memory.md), and [ranks retrieval results](concepts/retrieval-and-ranking.md).
Use [tokens and grants](guides/tokens-and-grants.md) to set access.
+
+
+
+
## Guides
Use the [guides](guides/index.md) for tasks such as connecting an agent, comparing memory
@@ -70,12 +84,18 @@ setups, and tracing a long run.
The [features index](features/index.md) covers memory, documents, code, work records,
and access and audit controls.
-## 6. Code index
+
+
+
Start with the [code-index overview](features/code-index/overview.md), add a
[repository](features/code-index/repositories.md), and check its
[indexing status](features/code-index/freshness.md).
+
+
+
+
## Architecture
Read the [system overview](architecture/system-overview.md),
diff --git a/docs/operations/deployment.md b/docs/operations/deployment.md
index 4d8b4ae0d1..21674f746b 100644
--- a/docs/operations/deployment.md
+++ b/docs/operations/deployment.md
@@ -883,7 +883,7 @@ LOOM_JWT_SECRET=<...>
When switching an installed local stack, edit `~/.loom/.env` (or the checkout's `.env`)
and keep its existing random `LOOM_JWT_SECRET`; replacing it would invalidate tokens and
sealed credentials. Recreate the Loom container to load the changes, as shown in the
-[quickstart](../getting-started/quickstart.md#2-open-the-dashboard). Preserve the data
+[quickstart](../getting-started/quickstart.md). Preserve the data
volumes. Signing up does not automatically give a new account access to existing local
memories: provision the appropriate namespace grants through an operator.
diff --git a/docs/operations/troubleshooting.md b/docs/operations/troubleshooting.md
index 97ee2cc1c8..308787ea1b 100644
--- a/docs/operations/troubleshooting.md
+++ b/docs/operations/troubleshooting.md
@@ -539,7 +539,7 @@ each field means is in [monitoring](./monitoring.md#health-checks).
or `IDENTITY_INCOMPLETE` from a scoped token with no namespace in the body, is
authorization, not a bug ([tokens and grants](../guides/tokens-and-grants.md#namespace-access)).
Stranded `loom-flush-*.json` files in the temp directory are plugin captures that never
- reached the server ([headless bots](../guides/headless-bots.md#5-when-the-bot-is-quiet)).
+ reached the server ([headless bots](../guides/headless-bots.md)).
- **An MCP tool is missing from the listing.** Listings vary by the MCP URL's
`?toolset=`, never by caller, with one exception: a `coding` connection that the
`X-Loom-Code-Scope` header binds to a repository lists the code tools alone when its
diff --git a/docs/scripts/prepare-content.mjs b/docs/scripts/prepare-content.mjs
index a20d729ab6..a5cee3226d 100644
--- a/docs/scripts/prepare-content.mjs
+++ b/docs/scripts/prepare-content.mjs
@@ -1,5 +1,5 @@
import { createHash } from "node:crypto";
-import { cpSync, existsSync, mkdirSync, readdirSync, readFileSync, rmSync, statSync, writeFileSync } from "node:fs";
+import { cpSync, existsSync, mkdirSync, readdirSync, readFileSync, renameSync, rmSync, statSync, writeFileSync } from "node:fs";
import { fileURLToPath } from "node:url";
import { dirname, join, normalize, relative, resolve, sep } from "node:path";
import { spawnSync } from "node:child_process";
@@ -352,6 +352,7 @@ async function prepareContent() {
});
if (prepared !== text) writeFileSync(file, prepared);
}
+ promoteComponentPages();
const packagePath = fileURLToPath(import.meta.resolve("blume/package.json"));
const codemod = join(dirname(packagePath), "skills", "blume-migrate", "scripts", "mkdocs-codemod.mjs");
@@ -361,7 +362,9 @@ async function prepareContent() {
});
if (result.status !== 0) process.exit(result.status ?? 1);
- if (!existsSync(join(content, "index.md"))) process.exit("Blume content preparation produced no index page.");
+ if (!existsSync(join(content, "index.md")) && !existsSync(join(content, "index.mdx"))) {
+ process.exit("Blume content preparation produced no index page.");
+ }
for (const file of contentFiles(content)) {
let text = readFileSync(file, "utf8")
@@ -482,6 +485,36 @@ export function prepareTranslatedMarkup(text, englishSources) {
return written + text.slice(cursor);
}
+/** Blume content components are available in MDX pages, not Markdown pages. */
+function promoteComponentPages() {
+ for (const file of contentFiles(content)) {
+ if (!file.endsWith(".md")) continue;
+ const text = readFileSync(file, "utf8");
+ if (!/<\/?(?:Steps|Step)(?:\s|>)/.test(text)) continue;
+ writeFileSync(file, escapeMdxPlaceholders(text));
+ renameSync(file, `${file.slice(0, -3)}.mdx`);
+ }
+}
+
+/** Escape Markdown placeholders that MDX would otherwise parse as JSX tags. */
+function escapeMdxPlaceholders(text) {
+ let fenced = false;
+ return text
+ .split("\n")
+ .map((line) => {
+ if (/^\s*(```|~~~)/.test(line)) fenced = !fenced;
+ if (fenced) return line;
+ return line
+ .split(/(`[^`]*`)/)
+ .map((part, index) => {
+ if (index % 2) return part;
+ return part.replace(/<(?!\/?(?:Steps|Step)(?:\s|>))([A-Za-z][A-Za-z0-9_-]*)>/g, "<$1>");
+ })
+ .join("");
+ })
+ .join("\n");
+}
+
/** Move a generated translation's title into front matter for Blume to render once. */
export function normalizeTranslatedTitle(text, seo = {}) {
if (!text.startsWith("|yes| I["row builders + memory_versions mirror"]
```
-
-
-
+## 1. Write the migration and regenerate the schema
[Migrations](migrations.md) owns the rules: numbering, what counts as additive, runner directives, sort-key rebuilds, and `make schema-dump` / `make schema-check` against the pinned ClickHouse. In short:
@@ -27,9 +25,7 @@ flowchart TD
Until a deployment applies the migration, the client's schema guard refuses a read or write naming a table a pending migration would create, with `SCHEMA_PENDING`.
-
-
-
+## 2. Mirror every column on ReplacingMergeTree write paths
`loom.memory`, `loom.shared` and `loom.memory_embeddings` are `ReplacingMergeTree(version)` tables read with `FINAL`. Every handler that writes a new version row (set, tombstone, restore, touch, `update_by_id`, `bulk_set`, promote, demote) carries **every** persisted column forward. A column omitted on a later version row reads as zero under `FINAL`.
@@ -48,9 +44,7 @@ When you add a column to one of these tables:
Any new write path sets the server-stamped `actor` and `source_class` (`server.memory.domain.provenance`), never values from the request body.
-
-
-
+## 3. Classify the table for erasure
Erasure is a saga (`server/erasure/app/saga.py`). Its last step is a residue census over every table the read paths touch; any live row in scope fails the saga closed. `tests/unit/test_every_table_is_classified.py` fails for any `CREATE TABLE` in `schema.sql` that is not in exactly one of three lists in `server/erasure/store/census.py`:
@@ -78,18 +72,12 @@ For a `_CENSUS` table:
Test the step's statement shape with a stub client, as `tests/unit/test_erasure_repo.py` and
`tests/unit/test_erasure_late_steps.py` do.
-
-
-
+## 4. Classify any mutation
An `ALTER TABLE loom. UPDATE|DELETE` is a ClickHouse mutation: it rewrites parts asynchronously and is not transactional. `tests/unit/test_clickhouse_mutation_inventory.py` counts every visible one under `server/` against `_EXPECTED_MUTATIONS`. A new one fails until you add it there with a comment saying why.
Prefer a new version row on a `ReplacingMergeTree`, a tombstone column, or a lightweight `DELETE FROM`. Never use a mutation as a claim or lock a request waits on; the task inbox claims through a `KeeperMap` lease table instead.
-
-
-
-
## Checklist
- [ ] New `schemas/migrations/_.sql`, additive, idempotent; no merged file edited.
diff --git a/docs/development/adding-a-worker.md b/docs/development/adding-a-worker.md
index 9b5e46a794..caf48d881a 100644
--- a/docs/development/adding-a-worker.md
+++ b/docs/development/adding-a-worker.md
@@ -12,9 +12,7 @@ flowchart LR
V --> W["loom.worker_status /v1/admin/workers.status"]
```
-
-
-
+## 1. Write the pass
Create `server//workers/.py` with an `async def run_pass()`. The supervisor calls it once per interval and discards the return value. A small example is `server/tasks/workers/lease_sweep.py`:
@@ -47,9 +45,7 @@ The pass contract:
- **Cursor.** A paging worker reads `pass_context.resume_cursor()` and calls `pass_context.set_cursor(value)` where it stopped. The cursor is stored on the pass's `loom.worker_status` row, so a restarted process resumes.
- **A broad `except` says why:** `# noqa: BLE001 — `.
-
-
-
+## 2. Attribute its queries
The supervisor tags every pass:
@@ -66,9 +62,7 @@ from server.core.ch import set_query_tag
set_query_tag("worker.my_loop")
```
-
-
-
+## 3. Add its settings
Add the switch and the cadence to the area's section of `server/settings/catalog.py` (`Memory`, `Code`, `Tracker`, …). Each comment becomes the row's text in the generated [configuration reference](../reference/configuration.md).
@@ -84,9 +78,7 @@ Add the switch and the cadence to the area's section of `server/settings/catalog
Default a worker **off** when it needs credentials, spends on a provider, or serves a plane an operator opts into. Default-on workers run on every stack, including a laptop.
-
-
-
+## 4. Add the registry row
```python
(
@@ -126,9 +118,7 @@ def due_scope() -> list[tuple[str, str]]: ... # the (org, namespace) pairs this
That is `server/tracker/workers/embed.py`'s declaration. The check is one statement per table, bounded by `FIRST_PASS_DUE_TIMEOUT_SECONDS`. An unreadable table reads as due.
-
-
-
+## 5. Understand where it runs
**One supervisor per deployment.** `server/workers/leader.py` elects one process across every container and host through ClickHouse: the `workers_supervisor` key in the Keeper lock table `loom._migration_lock`. The holder renews every `LOOM_SUPERVISOR_LEASE_TTL_S / 6`; a holder that loses the lease stops its workers; when the holder dies, another process takes over after `LOOM_SUPERVISOR_LEASE_TTL_S` (default 30 s).
@@ -146,9 +136,7 @@ Run every replica in `auto`: any of them may become the leader. A `make server`
**Rolling upgrades.** An older build leaves the lease to a live newer build (see [Failure and recovery](../architecture/failure-and-recovery.md#background-workers)). The old leader releases the lease when it stops, and a newer process takes it on its next round, within seconds.
-
-
-
+## 6. Pin it in tests
- **Registry snapshot.** `tests/unit/test_worker_registry_snapshot.py` builds the worker list under three settings profiles (`defaults`, `all_on`, `production`) and compares every `WorkerSpec` field with `tests/unit/snapshots/worker_registry.json`. Regenerate it for an intended change only:
@@ -163,18 +151,12 @@ Run every replica in `auto`: any of them may become the leader. A `make server`
- **Generated docs.** `python scripts/codegen/docs_reference.py` regenerates the
[workers reference](../reference/workers.md); `make lint` fails while it is stale.
-
-
-
+## 7. Check it runs
- `/v1/admin/workers.status` merges this process's registry with the latest `loom.worker_status` row per worker, so the web tier shows workers running in the workers container.
- `/v1/health?include=workers` reports per-worker status and `workers_leader`: whether the answering process holds the lock, and why.
- Alert on `loom.worker.consecutive_failures{worker}` and `loom.worker.partial_failures{worker}` ([monitoring](../operations/monitoring.md)).
-
-
-
-
## Related
- [Extending Loom](extending-loom.md)
diff --git a/docs/development/adding-an-operation.md b/docs/development/adding-an-operation.md
index 933a0b36d5..c2639c6bcc 100644
--- a/docs/development/adding-an-operation.md
+++ b/docs/development/adding-an-operation.md
@@ -14,9 +14,7 @@ flowchart LR
The example is `calibration.get`, one of the smallest ops: `server/memory/api/models_calibration.py`, `server/memory/api/ops_calibration.py` and `server/memory/app/calibration.py`.
-
-
-
+## 1. Define the input and output models
Put them in the group's models module, `server//api/models_.py`. A models module holds Pydantic wire models only: it imports no handler.
@@ -45,9 +43,7 @@ Rules for the models:
- **No model-level "one of A or B" validators** on read inputs. The transport validates the body before authorization, so a raising `@model_validator` describes the op to a principal the namespace gate would refuse. Put the rule in the handler and raise `server.core.errors.ValidationError`. `tests/unit/test_op_inputs_after_gate.py` checks every registered op.
- **To retire a field**, delete it. A client that still sends it is served, with the field named in `ignored_args` ([unknown and removed fields](../reference/http-api.md#unknown-and-removed-fields)).
-
-
-
+## 2. Write the handler
One handler module per group, under `server//app/`. A handler is `async`, takes the input model and returns the output model. It imports the wire models at module top; the models never import a handler, so the import is acyclic:
@@ -68,7 +64,7 @@ async def handle_calibration_get(input: CalibrationGetInput) -> CalibrationGetOu
- The transport tags ClickHouse queries with `log_comment`; a handler does nothing.
- Read settings as `settings.`, never `getattr(settings, ...)`.
- If the op writes `loom.memory` or `loom.shared`, build rows with the builders in
- `server/memory/store/rows.py` ([adding a table](adding-a-table.md)).
+ `server/memory/store/rows.py` ([adding a table](adding-a-table.md#2-mirror-every-column-on-replacingmergetree-write-paths)).
### Ops addressed by an org-wide id
@@ -88,9 +84,7 @@ if row is None:
Answer as for a missing row, never 403: a 403 confirms the id exists in another tenant. Pass `Role.WRITER` and `strong=True` to `namespace_for_id` for a write, so the holders are read current. An op that must read the row first, such as `memory.redact`, checks it with `authz.row_in_scope` after the fetch ([row-scoped operations](../architecture/security.md#row-scoped-operations)).
-
-
-
+## 3. Declare the operation
```python
from server.operations.base import Operation, Role
@@ -122,16 +116,14 @@ The declaration lives in the group's ops module, `server//api/ops_
-
-
+## 4. Decide MCP visibility
`server/operations/toolsets.py` decides where the op is listed:
@@ -142,9 +134,7 @@ The op is **read-only** (MCP `readOnlyHint`, the `readonly` toolset) exactly whe
A listed op needs its description in `server/transport/mcp_descriptions.py`
(`TOOL_DESCRIPTIONS`). Write it for the model: when to call the tool, what it returns, what not to use it for. A description about a changed fact interpolates `revision_policy()` from the same module instead of stating its own. Name another op by its dotted op name; each listing renames a listed op to its tool and marks an unlisted one ([MCP reference](../reference/mcp.md#tool-list)). Never write an op as a call (`op(args)`), inside a longer code span, or with a hand-written "(via loom_op)". An op name given as a field's example value goes in single quotes (`'memory.ask'`), which the listing leaves as written.
-
-
-
+## 5. Check reach and maturity
An op's **reach** is derived (`Operation.reach`, `server/operations/reach.py`): its MCP roster membership plus a committed scan of the SDKs, `examples/`, `dev/` and `scripts/`, the plugin hooks, and the dashboard's `"/v1/"` call sites. `{"http_only"}` means only a raw `/v1/*` POST reaches it.
@@ -154,9 +144,7 @@ Every op is on every surface or says why not in code. HTTP serves every op in th
- A `stable` op is [listed under the MCP `all` toolset](../reference/operations.md#mcp-all-listing), or, if hidden from MCP, has another reach path, and is meant to have production callers; `python scripts/codegen/op_reach_census.py --call-counts --days 30` shows whether it has them. Declare a new op `experimental` unless it replaces a stable one.
- Refresh the manifest: `python scripts/codegen/op_reach_census.py --write-manifest` (writes `server/operations/reach_manifest.py`).
-
-
-
+## 6. Write the tests
| Test | What it asks of your op |
| -------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
@@ -169,9 +157,7 @@ Every op is on every surface or says why not in code. HTTP serves every op in th
If the leakage suite cannot synthesize a body for your op, it reports it; add a hint instead of skipping. An op that mutates the caller's own namespace goes in the suite's `_SKIP_OPS`, with the writer gate covered elsewhere. Integration tests need a running server (`LOOM_BASE_URL`) and skip without one. Mint tokens with the suite's helpers, not self-signup, which CI does not enable.
-
-
-
+## 7. Regenerate and run the gates
```bash
python scripts/codegen/sdk_py_gen.py # sdk/python/loom/ops.py
@@ -192,10 +178,6 @@ CI fails when a generated file is stale. The generated SDK files give every clie
`python scripts/codegen/wire_changelog.py ` prints what changed for clients between two revisions. The release notes are built from it.
-
-
-
-
## Before you open the PR
- [ ] Models, handler, declaration, `OPERATIONS` entry (and `_OPERATION_MODULES` for a new group).
diff --git a/docs/development/adding-language-support.md b/docs/development/adding-language-support.md
index 52e63ffbe6..ec1c13b9b1 100644
--- a/docs/development/adding-language-support.md
+++ b/docs/development/adding-language-support.md
@@ -31,9 +31,7 @@ Languages `lang_for_path` does not name are detected in `lang_detect.py`, so add
Every module under `server/code/domain/extract/` is either in a stage of `STAGE_MODULES` or named, with a reason, in `NON_EXTRACTOR_MODULES` in `tests/unit/test_code_extractor_stamp.py`. Put a new lane module in `NON_EXTRACTOR_MODULES`, or that test fails.
-
-
-
+## 1. Choose the lane's shape
| Shape | Examples | You provide |
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
@@ -45,9 +43,7 @@ Every module under `server/code/domain/extract/` is either in a stage of `STAGE_
A grammar lane's grammar is **not** in `STAMPED_GRAMMARS`, so upgrading it moves no stamp. The lane owns re-deriving its rows.
-
-
-
+## 2. Write the parser
`parse_(path: str, source: bytes) -> ParsedFile` returns the language tag, the symbols (`treesitter.Symbol`: qualified name, kind, span, signature), the includes and what the edge stage needs. Follow the nearest existing lane:
@@ -75,9 +71,7 @@ _PARSERS = {
and add the extension to `LANG_BY_EXTENSION` (`".rs": "rust"`). The wrapper imports the lane lazily, so an optional grammar stays optional. A new tree-sitter grammar also goes in `bounded_parse._LOADERS`, which every parse runs through first.
-
-
-
+## 3. Test the lane
- **A lane test**, `tests/unit/test_code_lang_.py`, parses small inline sources and asserts names, kinds, spans, includes and edges. Skip when the grammar is absent: `pytest.importorskip("tree_sitter_rust")`. `test_code_lang_rust.py` and `test_code_lang_typescript.py` are the models.
- **The lanes corpus.** Add fixtures under `tests/fixtures/code_lanes//`: synthetic, or open-source excerpts under their own licence, listed in `tests/fixtures/code_lanes/NOTICE.md`. `tests/unit/test_code_lanes_corpus.py` derives languages, symbols, facets, includes and edges from every fixture and compares them with `tests/fixtures/code_lanes/expected.json`. Regenerate and review the diff:
@@ -94,9 +88,7 @@ and add the extension to `LANG_BY_EXTENSION` (`".rs": "rust"`). The wrapper impo
`NON_EXTRACTOR_MODULES`.
- **Retrieval.** For a lane that should answer `code.search` or `code.symbol` well, run the code-intelligence gate before and after. `make bench-code-intel-dry` checks the question set offline; `make bench-code-intel` runs it against a server with a real embedder, never the fake one ([running benchmarks](../benchmarks/running.md)).
-
-
-
+## 4. Bring existing namespaces up to date
A lane outside the stamp changes nothing already indexed. New commits use the lane; old files keep their previous rows (often chunk-only). Re-derive them with a targeted backfill:
@@ -109,9 +101,7 @@ loom code backfill --org --namespace --paths-file rust-pa
> **Warning:** if a change must touch a stamped module (a `chunker.py` fix, a `treesitter.py` extension), say so in the PR. Every deployment that takes it re-derives the moved stages for every file of the affected families in every namespace. A `chunker.py` change moves only `chunk`; an `edges_treesitter.py` change moves `edge`, `chunk` and `guard`; a parser change moves every stage.
-
-
-
+## 5. Add a compiler tier (optional)
A compiler tier pays off when fast-tier edges are ambiguous (overloads, dynamic dispatch, re-exports) and a SCIP indexer exists. `TIERS` in `server/code/domain/index/compiler_tiers.py` lists the tiers. Each `TierSpec` names the indexer (`scip-clang`, `scip-typescript`, `scip-go`, `scip-python`), its `code_index_state` watermark key (`scip_commit`, `scip_commit_ts`, `scip_commit_go`, `scip_commit_py`) and the workers that move it. A new tier needs:
@@ -131,10 +121,6 @@ A compiler tier pays off when fast-tier edges are ambiguous (overloads, dynamic
Compiler-tier rows carry `tier='scip'`. Reads merge them with the fast tier by qualified name, preferring the compiler tier. Files the indexer skips, and commits before their delta lands, still read from the fast tier.
-
-
-
-
## Related
- [Code index overview](../features/code-index/overview.md)
diff --git a/docs/features/integrations/agent-substrate.md b/docs/features/integrations/agent-substrate.md
index 1a76a17f26..3054a7336b 100644
--- a/docs/features/integrations/agent-substrate.md
+++ b/docs/features/integrations/agent-substrate.md
@@ -26,9 +26,7 @@ connections from the gateway pods, not from the actors. Each row records the tok
subject, which tells the actors apart; the row's `agent` is the MCP client's name, which
actors running the same client share.
-
-
-
+## 1. Install Loom in the cluster
Install the chart as [Kubernetes](../../operations/kubernetes.md) describes, in namespace
`loom` with release name `loom`, which names the Service `loom`. The agents need no
@@ -51,9 +49,7 @@ networkPolicy:
app: atenet-egress
```
-
-
-
+## 2. A token per agent
Give each agent its own token, with a service-account subject named for the atespace and
the Substrate actor. Loom records that subject on each row the agent writes, and the token's
@@ -109,9 +105,7 @@ kubectl -n loom-tokens-research create secret generic research-agent \
--from-literal=token="$TOKEN" --dry-run=client -o yaml | kubectl apply -f -
```
-
-
-
+## 3. Configure the agent and create its actor
Substrate's documentation describes no MCP configuration for actors: configure the agent's
MCP client in its image or as literal environment values in the actor template. The server
@@ -145,9 +139,7 @@ kubectl ate create actor-template -f template.yaml
kubectl ate create actor research-agent --template=research-agent -a research
```
-
-
-
+## 4. Allow the actor to reach Loom, with its token
An actor has one egress policy. This one, for the actor created above, allows HTTP to
Loom's Service and replaces the `Authorization` header the agent sends with
@@ -196,10 +188,6 @@ With the policy in place, start the actor:
kubectl ate resume actor research-agent -a research
```
-
-
-
-
## Several agents
- Agents in one Loom namespace share everything they write. A sub-agent that should read
@@ -207,7 +195,7 @@ kubectl ate resume actor research-agent -a research
(`--namespace-role team=viewer --namespace-role research=writer`;
[mint a token](../../guides/tokens-and-grants.md#mint-a-token)).
- Each actor gets its own token, Secret and egress policy; an actor in another atespace gets
- that atespace's own token namespace and grant.
+ that atespace's own token namespace and grant ([step 2](#2-a-token-per-agent)).
- Hand work between agents with the [task inbox](../tasks-and-decisions.md#task-inbox).
## Related
diff --git a/docs/getting-started/agent-setup.md b/docs/getting-started/agent-setup.md
index 77b3b590ba..eb3a5968c0 100644
--- a/docs/getting-started/agent-setup.md
+++ b/docs/getting-started/agent-setup.md
@@ -44,9 +44,7 @@ This copy names no release, so its commands do not run as they are. Follow the
what a check expects, or report `PASS` for a step that did not run. A `FAIL` line is a
correct report.
-
-
-
+## 1. Install the release
```sh
mkdir -p ~/loom-agent-setup
@@ -57,12 +55,10 @@ curl -fsSL "https://github.com/ClickHouse/loom/releases/download/v/inst
The installer verifies the bundle's SHA-256, installs under `~/.loom`, starts the stack
and waits for the server's `/v1/health`. If the command fails, the report is its `install`
-line alone; do not go on. The [quickstart](quickstart.md) says what the
+line alone; do not go on. The [quickstart](quickstart.md#1-boot-the-stack) says what the
installer does in full.
-
-
-
+## 2. Install the plugin
The plugin comes from the same release's source, so it matches the server:
@@ -90,9 +86,7 @@ with no token. **The person** now starts a new session of the agent (Codex: an i
`codex` run, where they also approve the plugin's hooks), gives it this text again and
says "continue at step 3". Steps 3 and 4 run in that session.
-
-
-
+## 3. Run the check
Save this script as `loom-setup-check.py` and run `python3 loom-setup-check.py`. It uses
only the Python standard library and talks to Loom over HTTP. It writes into the namespace
@@ -243,9 +237,7 @@ What each check must see:
When `server` fails, the script writes nothing and runs no other check.
-
-
-
+## 4. Check the agent's connection
Call your `loom_search` tool once, with the query `agent setup check`, and run
`claude plugin list` (or `codex plugin list`). The line is
@@ -253,10 +245,6 @@ Call your `loom_search` tool once, with the query `agent setup check`, and run
shows `loom@loom` enabled, otherwise
`[FAIL] agent `.
-
-
-
-
## Report
Give the script's lines, then the `agent` line, then one summary that counts the `agent`
diff --git a/docs/getting-started/evaluate.md b/docs/getting-started/evaluate.md
index 25d863e8e3..061ab54196 100644
--- a/docs/getting-started/evaluate.md
+++ b/docs/getting-started/evaluate.md
@@ -43,16 +43,14 @@ Pre-registering the gates prevents a convenient metric or slice from becoming th
after the run. Keep failures and abstentions visible; report request errors separately
instead of silently counting or discarding them as retrieval misses.
-
-
-
+## 1. Product smoke test
This takes about 15 minutes and proves wiring, persistence and visibility—not semantic
quality.
-1. [Boot the local stack](quickstart.md) and confirm `/v1/health` reports
+1. [Boot the local stack](quickstart.md#1-boot-the-stack) and confirm `/v1/health` reports
`status: ok`.
-2. [Write and search a fact](quickstart.md).
+2. [Write and search a fact](quickstart.md#4-first-memory-over-http).
3. [Connect a coding agent](connect-a-coding-agent.md), tell it a durable preference, open
a fresh session and ask for that preference.
4. Correct the fact, then confirm the dashboard shows its source and version history.
@@ -64,9 +62,7 @@ answer, an unrelated question abstains, and the dashboard shows the writer and h
The result says nothing about production recall while health reports `fake_embedding` or
`fake_llm`.
-
-
-
+## 2. Evaluate your workload
Configure [real providers](../operations/deployment.md#providers), reset or re-embed data
if the vector width changed, and record the resolved models from `/v1/health`. Use an
@@ -237,9 +233,7 @@ it defers MCP tool definitions.
slice to a general claim.
- Save per-question outputs, including errors and misses—not only aggregate scores.
-
-
-
+## 3. Audit or reproduce published results
The README is a scorecard, not the evidence ledger. For every published number:
@@ -255,10 +249,6 @@ license are listed under [datasets](../benchmarks/running.md#datasets). Full pub
can take hours and incur provider charges; start with the documented smoke slice, then run
the complete protocol before publishing a comparison.
-
-
-
-
## What to publish
Publish a result in the README only when it is representative, understandable in one row,
diff --git a/docs/getting-started/first-agent.md b/docs/getting-started/first-agent.md
index a1d4b7c989..14e5d0a9cc 100644
--- a/docs/getting-started/first-agent.md
+++ b/docs/getting-started/first-agent.md
@@ -8,15 +8,13 @@ seo:
This tutorial builds a small agent with the Python SDK. It continues from the
[quickstart](./quickstart.md): the stack runs on `http://localhost:7777` and the Python
-SDK is installed ([quickstart step 5](./quickstart.md)). Every
+SDK is installed ([quickstart step 5](./quickstart.md#5-first-memory-from-python)). Every
step runs on the stock stack. Meaningful extraction and grounded `memory.ask` answers
need a configured real LLM; ranking is meaningful on the released stack's local embedder,
not on a checkout's fake one
([providers](../operations/deployment.md#providers)).
-
-
-
+## 1. Give the agent an identity
Every row Loom stores carries the identity tuple `(org, namespace, agent, user_id,
session_id)`. The `Agent` binds the first three; `user_id` and `session_id` travel per
@@ -57,9 +55,7 @@ facts, and one namespace shared by several agents must still say who wrote what.
[identities and namespaces](../concepts/identities-and-namespaces.md) page explains the
model.
-
-
-
+## 2. Store facts and handle abstain
```python
async def remember_and_recall(a: Agent) -> None:
@@ -106,9 +102,7 @@ does the user prefer?", user_id=USER)` returns `answer`, `abstain` and the `memo
it cited. Grounded answers need a configured real LLM; the fake one can return
deterministic output for development and tests.
-
-
-
+## 3. Hold a conversation as a session
A `Session` is what an agent loop keeps between turns and across restarts. It binds one
`(user_id, session_id)` scope and four verbs to it:
@@ -144,9 +138,7 @@ SDK logs a warning) and extraction still runs.
[Conversations and sessions](../features/conversations-and-sessions.md) covers threads,
digests and session briefs.
-
-
-
+## 4. Load context at session start
Outside a session, one call assembles the bounded block an agent wants before its first
turn: working memory first, then the profile, relevant memories, matching procedures and
@@ -167,9 +159,7 @@ instead of failing the pack. Working memory is scratchpad state, not retrieval m
is loaded first and never embedded or ranked
([Working memory and profiles](../features/memory/working-memory-and-profiles.md)).
-
-
-
+## 5. Record a task as a run
A run is one agent execution: what it was asked, what it relied on and how it ended.
Naming the memories a run relied on is the feedback loop: those keys are credited in
@@ -209,9 +199,7 @@ The same two calls are available directly as `a.run.begin(goal=...)` and
stored as a `reflection` memory. `a.run.get(run_id)` replays a run with what it wrote,
recalled and cost. [Runs](../features/runs.md) covers reflections, retention and grades.
-
-
-
+## 6. Put it together
```python
async def main() -> None:
@@ -230,10 +218,6 @@ agent, `/runs` for the run, and `/conversations` for the thread. Blocking code u
`loom.SyncAgent`, which takes the same arguments and exposes every method as a blocking
call.
-
-
-
-
## The same agent in TypeScript
The TypeScript SDK (`@clickhouse/loom`;
@@ -286,19 +270,13 @@ await bot.call(
`memory.ask`. The [TypeScript SDK reference](../reference/typescript-sdk.md) covers the
full surface.
-
-
-
+## 7. Connect a coding agent
A coding agent reads the same namespace through MCP tools. What you stored from Python
is visible to it when its token reads that namespace.
[Connect a coding agent](./connect-a-coding-agent.md) covers the plugins and
`loom install`.
-
-
-
-
## Next
- [Memory](../concepts/memory.md): what happens between the write and the read.
diff --git a/docs/getting-started/quickstart.md b/docs/getting-started/quickstart.md
index d7b906187a..c534527d9e 100644
--- a/docs/getting-started/quickstart.md
+++ b/docs/getting-started/quickstart.md
@@ -14,9 +14,7 @@ Run Loom locally with Docker. The default install listens only on localhost and
Use Docker Desktop or Docker Engine with Compose 2.20 or later. Leave port `7777` free
for Loom. On Windows, run the installer in a WSL 2 terminal where `docker` works.
-
-
-
+## 1. Boot the stack
### Fast path: released image, no clone
@@ -212,8 +210,8 @@ to localhost. Before sharing it with a team, configure [operator access](../oper
and [TLS](../operations/deployment.md#proxy-and-tls). Configure [real models and API keys](./models-and-keys.md)
as well; selecting multi-user mode does not replace the fake LLM.
-For an already running single-user stack, follow the switching instructions below instead;
-container recreation preserves the existing data volumes.
+For an already running single-user stack, follow the [switching instructions](#2-open-the-dashboard)
+instead; container recreation preserves the existing data volumes.
### Contributor path: build a checkout
@@ -321,9 +319,7 @@ docker compose --project-directory "$HOME/.loom" exec loom loom doctor
- `loom doctor` prints one line per server-side check. `--json` gives JSON. From a source
checkout stack, run `docker compose --env-file .env -f compose.yaml -f dev/docker-compose.dev.yml exec loom loom doctor`.
-
-
-
+## 2. Open the dashboard
`http://localhost:7777/` opens straight into the dashboard in `single-user` mode;
in multi-user mode, sign up or sign in first. In `single-user` mode
@@ -360,9 +356,7 @@ so anyone who reaches the port can then sign up. Before making the server reacha
team, follow the [deployment guide](../operations/deployment.md#identity-modes) for
operator access and [TLS](../operations/deployment.md#proxy-and-tls).
-
-
-
+## 3. Get a token
In single-user mode a token is optional. Minting one anyway keeps your scripts working
when auth is turned on, as long as they name their `org` (or send it blank), `namespace`
@@ -402,9 +396,7 @@ export LOOM_API_KEY=""
Claims, roles and grants are in [Tokens and grants](../guides/tokens-and-grants.md).
-
-
-
+## 4. First memory over HTTP
Every operation is a `POST /v1/` with a JSON body. A fresh install with the stock
`.env`, from the installer or a checkout, is single-user: no token, and an everyday memory
@@ -436,9 +428,7 @@ agent's memories in the namespace, including those added in the dashboard; name
`GET /v1/operations` lists every operation, and lets you try
each one from the browser. Shapes are in the [HTTP API reference](../reference/http-api.md).
-
-
-
+## 5. First memory from Python
```bash
pip install clickhouse-loom # or, from a clone: pip install ./sdk/python
@@ -494,9 +484,7 @@ The client surfaces are in the [Python SDK](../reference/python-sdk.md) and
[TypeScript SDK](../reference/typescript-sdk.md) references, and the
[Rust SDK usage](https://github.com/ClickHouse/loom/blob/main/sdk/rust/README.md#use).
-
-
-
+## 6. First memory from a coding agent
If the installer connected your agent, skip to the last paragraph of this section.
@@ -544,9 +532,7 @@ Start a new session and say _"Remember that I never deploy on Friday."_ The agen
`loom_search` and answers from the stored fact. The model decides when to save and
search from the tool descriptions; there are no trigger words.
-
-
-
+## 7. See it in the dashboard
| Page | Shows |
| ----------------- | ------------------------------------------------- |
@@ -556,10 +542,6 @@ search from the tool descriptions; there are no trigger words.
The rest is in [Dashboard](../features/dashboard.md).
-
-
-
-
## Optional: index a repository on the released stack
Adding a repository from the dashboard is refused on this stack with `SANDBOX_UNAVAILABLE`:
@@ -638,7 +620,7 @@ the answer and the chunks it cited. With the fake LLM it prints the top
| ----------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `set_from_messages` writes no facts | An empty result can be valid when the text contains nothing memorable. Check the provider configuration in [Models and keys](./models-and-keys.md); meaningful extraction needs a real LLM. |
| Search results look arbitrary | The embedder is a fake one (`fake-ngram-*` in `.env`). Switch it as [Models and keys](./models-and-keys.md) says, which re-embeds what is stored. Do not delete your volumes to change models. |
-| 401 `AUTH_INVALID` after turning auth on | No token, or one signed with another `LOOM_JWT_SECRET`. Re-mint with the Compose command in the token step above. |
+| 401 `AUTH_INVALID` after turning auth on | No token, or one signed with another `LOOM_JWT_SECRET`. Re-mint with the Compose command in [Get a token](#3-get-a-token). |
| The dashboard returns 503 | The server runs from source (`make server`) without a built frontend. Run `make frontend-build`. |
| Released stack does not become healthy | Run `docker compose --project-directory "$HOME/.loom" logs --tail 100 loom clickhouse`. See [Troubleshooting](../operations/troubleshooting.md). |
| Adding a repository answers `SANDBOX_UNAVAILABLE` | The stack runs without the repository-job sandbox. Index the repository through `LOOM_CODE_REPOS_JSON` ([Index a repository](#optional-index-a-repository-on-the-released-stack)). |
diff --git a/docs/guides/agent-integration.md b/docs/guides/agent-integration.md
index 043a4486ff..1f08b50364 100644
--- a/docs/guides/agent-integration.md
+++ b/docs/guides/agent-integration.md
@@ -20,9 +20,7 @@ system_prompt = "You triage support tickets.\n\n" + await agent.guide()
Over MCP the primer names the call; an Agent-Skills client installs it with
`npx skills add ClickHouse/loom --skill loom`.
-
-
-
+## 1. Choose the client surface
| Surface | Use it when | What you get |
| ------------------------------------------------------------ | ----------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
@@ -69,9 +67,7 @@ ID, outcome and latency, and confirm which evidence reached the model. SDK
Keep startup metadata, context retrieval, investigative lookups, checks and recording
separate when reporting tool adoption and cost.
-
-
-
+## 2. Choose the identity
Every row carries the identity tuple `(org, namespace, agent, user_id, session_id)`, plus
`run_id`. The token fixes `org` and the namespaces; the rest travels per call.
@@ -92,9 +88,7 @@ Every row carries the identity tuple `(org, namespace, agent, user_id, session_i
See [namespace access](tokens-and-grants.md#namespace-access).
- **No secret or personal identifier in `agent`:** it is stamped on every ledger row.
-
-
-
+## 3. Decide what to write
Pick the plane first. Durable memory is embedded, ranked, conflict-checked and versioned.
Working memory is read by key and never ranked. Knowledge holds chunked documents.
@@ -135,9 +129,7 @@ that works cases; [trace and resume](trace-and-resume.md) covers checkpoints.
A statement from the user ("we deploy Tuesdays") is the trigger to write. Do not search
first; the server handles duplicates and conflicts.
-
-
-
+## 4. Read the write's answer
A `memory.set` reply is a receipt. Read it:
@@ -152,9 +144,7 @@ A `memory.set` reply is a receipt. Read it:
Pass `if_match_sha256` (from a `memory.get`) when two writers may race on one key; a stale
hash is refused instead of overwriting.
-
-
-
+## 5. Read with one call per question
1. **Load context once per task.** `context.pack` returns a token-budgeted bundle: profile
sections, working memory, the memories relevant to `query`, procedures, and optionally
@@ -187,9 +177,7 @@ else:
reply = hits[0].content_excerpt
```
-
-
-
+## 6. Record runs
A run is one execution of a task: its goal, what it recalled and relied on, what it wrote and
its outcome. Recorded runs let ranking learn which memories help ([runs](../features/runs.md)).
@@ -211,9 +199,7 @@ An agent outside the plugins should also hand the finished transcript to
`memory.set_from_messages` (or close an `agent.session(...)`), so the server extracts what was
durable.
-
-
-
+## 7. Follow the memory skill's review
The plugins ship a `loom-memory` skill
(`integrations/claude-code-plugin/skills/loom-memory/`, generated into the Codex plugin)
@@ -238,10 +224,6 @@ skills cover code questions (`loom-code`, also at `skills/loom-code/` for any cl
reworking a namespace (`loom-optimize`), session restore (`loom-session`) and client health
(`loom-status`).
-
-
-
-
## Mistakes to avoid
`namespace.audit` detects each of these; [optimize a namespace](optimize-namespace.md) turns
diff --git a/docs/guides/debugging.md b/docs/guides/debugging.md
index 260fa80a9e..bee14c366c 100644
--- a/docs/guides/debugging.md
+++ b/docs/guides/debugging.md
@@ -16,9 +16,7 @@ flowchart TD
G["memory.search explain=true per-component scores"] -.-> B
```
-
-
-
+## 1. Capture the request's ids
Every HTTP response carries:
@@ -40,9 +38,7 @@ curl -si "$LOOM_BASE_URL/v1/memory.search" -H "Authorization: Bearer $LOOM_API_K
points at the query. A large `app` with a small `ch` points at a provider call
(embedding, rerank, LLM).
-
-
-
+## 2. Join the request across systems
The same id is in `loom.agent_events.request_id`, the Langfuse trace metadata, and the
span attribute `loom.request_id` in `default.otel_traces`.
@@ -74,9 +70,7 @@ Spans go to `default.otel_traces` (in `LOOM_CLICKSTACK_DATABASE` when it is set)
> free-text argument with a `sha256:<16 hex>/` shape. To see what was asked, use
> the search trace log below or your own client log.
-
-
-
+## 3. Explain a search answer
**Why did this rank here?** `memory.search` with `explain=true` attaches `score_components`
to each served hit: the ranking signals and, after a reranker, its move (`rerank_from`,
@@ -122,10 +116,6 @@ per search: `returned_keys`, `returned_scores`, `abstain`, `retrieval_risk`,
`latency_ms`, and the `query` when `LOOM_LANGFUSE_CAPTURE_IO_LEVEL` is not `off` (its
default is `off`, so by default the rows carry keys and scores without the question).
-
-
-
-
## Diagnose coding-agent overhead
Separate three clocks: the agent's model requests, its tool and local work, and the
@@ -185,9 +175,7 @@ failed solutions, and keep setup and judging costs separate from coding costs.
Record whether source and lessons were present before attributing a bad patch to
retrieval. Successful delivery does not establish relevance or correct use.
-
-
-
+## 4. Explain a write
- **The write's own answer.** `memory.set` returns `status`, `conflict_verdict`, `peers`,
`duplicate_of`, `merged_into_key`, `noop` and `advisories`. A write that "disappeared"
@@ -207,10 +195,6 @@ retrieval. Successful delivery does not establish relevance or correct use.
- **A run's view.** `run.get(run_id)` returns what a run recalled (`recalled_keys`), what
it wrote, its turns and its cost ([trace and resume](trace-and-resume.md)).
-
-
-
-
## Related
- [Troubleshooting](../operations/troubleshooting.md)
diff --git a/docs/guides/headless-bots.md b/docs/guides/headless-bots.md
index 96b0951e00..629759ccc1 100644
--- a/docs/guides/headless-bots.md
+++ b/docs/guides/headless-bots.md
@@ -4,9 +4,7 @@ A headless bot runs with no person to paste a token, notice a silent failure or
"remember this". This guide covers the bot's identity, a connection check, three runtimes,
what the bot writes, and how to diagnose a bot that has gone quiet.
-
-
-
+## 1. Give the bot an identity
The `loom` CLI ships in the server image and installs from a clone with `pip install -e .`.
The SDK package (`clickhouse-loom`) has no CLI.
@@ -53,9 +51,7 @@ loom mint-token --subject ci-reviewer --org --namespaces agent-ci --roles
See [tokens and grants](tokens-and-grants.md) for roles, lifetimes and rotation.
-
-
-
+## 2. Check the connection before the first run
```bash
LOOM_BASE_URL=https:// LOOM_API_KEY="$(cat token.txt)" loom doctor --client
@@ -72,9 +68,7 @@ fix, and the exit code is non-zero, so the command works as a CI gate:
`--json` emits the checks and the problem list as JSON for a pipeline that parses them.
-
-
-
+## 3. Connect the runtime
### Claude Agent SDK or `claude -p`
@@ -157,19 +151,15 @@ async with Agent(org="acme", namespace="agent-nightly-triage", agent="nightly-tr
See the [Python SDK reference](../reference/python-sdk.md) and
[framework integrations](../features/integrations/frameworks.md).
-
-
-
+## 4. Decide what the bot writes
The plugins capture a coding session on their own. A bot outside them decides what to write.
In short: record decisions and failures, not transcripts; recall once before a task, not once
per step; hand a finished run's transcript to `memory.set_from_messages`; and report what the
run relied on with `run.complete(memories_used=[...])`.
-[Agent integration](agent-integration.md) covers each choice.
+[Agent integration](agent-integration.md#3-decide-what-to-write) covers each choice.
-
-
-
+## 5. When the bot is quiet
Run `loom doctor --client` on the bot's machine. It reports each of the usual causes on its
own line:
@@ -181,10 +171,6 @@ own line:
| 403 on every write | The token is a `viewer` on the namespace the bot writes to |
| Captures never appear | A background flusher never delivered them: stranded `loom-flush-*.json` files in the temp directory |
-
-
-
-
## Related
- [Tokens and grants](tokens-and-grants.md)
diff --git a/docs/guides/importing-clickgap-memory.md b/docs/guides/importing-clickgap-memory.md
index 4ea00c48a9..5fff9080da 100644
--- a/docs/guides/importing-clickgap-memory.md
+++ b/docs/guides/importing-clickgap-memory.md
@@ -34,9 +34,7 @@ Two commands do the work:
`version`. A re-import supersedes under `ReplacingMergeTree(version)` and the row count stays
the same.
-
-
-
+## 1. Dry-run
No writes. The dry run checks that every timestamp parses, prints the kind → type and TTL
crosstab and the category count, and probes the embedder so rows do not land unembedded.
@@ -49,9 +47,7 @@ loom import-clickgap \
Confirm the crosstab matches the source and that the embedder is reachable.
-
-
-
+## 2. Import
Use a **dedicated namespace** (`clickgap`) so rollback is a single `namespace.delete`. The
export carries no vectors, so every row is embedded on import with the live
@@ -78,10 +74,6 @@ analytics.
> **Warning:** `--seed-recall-events` is additive and not idempotent: run it once, into a
> fresh namespace. It **drops `pr_number`**, because Loom usage events have no PR column.
-
-
-
-
## Recall signal
The importer mirrors `recall_count` onto `memory_embeddings.reinforcement_count` and
@@ -97,9 +89,7 @@ reinforcement terms ([retrieval and ranking](../concepts/retrieval-and-ranking.m
workload depends on recall-frequency ordering, validate that the resulting order is
acceptable (the validator reports recall-order τ) before cutover.
-
-
-
+## 3. Validate before cutover
The validator mints its own admin token with `server.auth.jwt.mint_token`, so it needs
`LOOM_JWT_SECRET` and an explicit `LOOM_BASE_URL`: there is no default target. Its probes
@@ -136,10 +126,6 @@ Summaries (`summary → episodic`) are excluded from probes, since they are non-
design. `--seed` (default 42) makes the probe sample reproducible; `--concurrency`
(default 8) bounds concurrent searches.
-
-
-
-
## Use suppression memories
The `false_positive` lessons ("looks like a bug, do NOT re-raise") are the suppression
diff --git a/docs/guides/optimize-namespace.md b/docs/guides/optimize-namespace.md
index c57d90c581..bcf139a5e9 100644
--- a/docs/guides/optimize-namespace.md
+++ b/docs/guides/optimize-namespace.md
@@ -50,9 +50,7 @@ dry_run}`; a dry run adds `memory_type` and `value_preview`. After a move:
- `memory.get(from_key, follow=true)` serves the new row;
- `memory.search` and `memory.list` show only the new row.
-
-
-
+## 1. Audit
```bash
loom audit-namespace --org --namespace --window-days 7 --samples 5
@@ -80,9 +78,7 @@ The dashboard's namespace audit panel shows the same audit. `context.pack` carri
warnings among `exact_key_store`, `double_encoded_values`, `unembedded_rows` and
`coordination_as_memory`), so an agent sees it at session start.
-
-
-
+## 2. Plan
Write one section per finding. Only codes the audit returned get a section.
@@ -116,17 +112,13 @@ Store the plan as a knowledge document at `loom:////_optimize/plan-
-
-
+## 3. Get approval
The namespace owner approves in writing. A plan shown is not a plan approved. A partial
approval applies the named sections only. If the owner's writer is running (the audit's
`sets` in the window says so), tell them; the last hour of rows is out of scope either way.
-
-
-
+## 4. Apply
Back up first if the namespace matters: `memory.list … fields=["value"]` to a JSONL file,
`namespace.snapshot` (HTTP or SDK; it is not served over MCP), or on the server
@@ -153,17 +145,13 @@ curl -s "$LOOM_BASE_URL/v1/memory.move" -H "Authorization: Bearer $LOOM_API_KEY"
"dry_run": true}'
```
-
-
-
+## 5. Measure
Run the audit again over the same window and append a before/after table to the plan
document (`knowledge.upsert` on the same `source_uri`). Give the owner the
[writer rules](investigation-agent-memory.md#writer-rules).
-
-
-
+## 6. Retire nothing
Old keys stay readable through the redirect for as long as the owner wants. Once the writer
uses the new keys, the owner may tombstone the old ones with `memory.delete` (soft:
@@ -173,10 +161,6 @@ uses the new keys, the owner may tombstone the old ones with `memory.delete` (so
> answers `found: false`, a client may fall back to local state, and two stores then
> disagree. The redirect exists to prevent that.
-
-
-
-
## Related
- [Investigation agent memory](investigation-agent-memory.md): the target layout
diff --git a/docs/guides/query-from-postgres.md b/docs/guides/query-from-postgres.md
index 61643cf0ed..c49542f7ff 100644
--- a/docs/guides/query-from-postgres.md
+++ b/docs/guides/query-from-postgres.md
@@ -17,9 +17,7 @@ extension. Use a separate database, or a separate service, from the one Loom's
CI tests the release `LOOM_PGCH_VERSION` names in `.github/workflows/ci.yml` on Postgres 16
and 18 (`tests/integration/test_pg_clickhouse_live_ch.py`).
-
-
-
+## 1. Make a SQL user for the tenant
On the Loom side, as an operator ([access](../reference/sql-surface.md#access)):
@@ -29,9 +27,7 @@ loom sql-access grant --user acme_bi --org acme --namespaces support,research
It prints the user's password once.
-
-
-
+## 2. Install the extension
The extension is in the `ghcr.io/clickhouse/pg_clickhouse:-`
images and on [PGXN](https://pgxn.org/dist/pg_clickhouse/), to build into a self-managed
@@ -60,9 +56,7 @@ As the owner:
CREATE ROLE app_reader LOGIN PASSWORD '';
```
-
-
-
+## 3. Point it at the ClickHouse service
```sql
CREATE SERVER loom_ch FOREIGN DATA WRAPPER clickhouse_fdw
@@ -95,9 +89,7 @@ These are the extension's defaults, written down so a later release's defaults c
one. A session that sets another setting fails in ClickHouse with `READONLY`: the SQL user's
profile refuses it ([access](../reference/sql-surface.md#access)), whatever the role says.
-
-
-
+## 4. Import the views
```sql
CREATE SCHEMA loom;
@@ -121,9 +113,7 @@ imported with, so to pick up new ones drop the schema (and any Postgres view bui
tables) and run the import and the grants again:
`DROP SCHEMA loom CASCADE; CREATE SCHEMA loom;`.
-
-
-
+## 5. Query and join
```sql
-- The facts Loom holds about each account on the support team
@@ -142,10 +132,6 @@ GROUP BY day ORDER BY day;
`value` is NULL where Loom withholds it; `value_withheld` says why.
-
-
-
-
## Cost and scale
- `EXPLAIN (VERBOSE)` shows which part of a query runs in ClickHouse. A join between a
diff --git a/docs/index.md b/docs/index.md
index 1812692f8f..2f6a8c236e 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -35,45 +35,31 @@ or [casos de uso en español](https://loom.clickhouse.com/docs/es/use-cases).
[Video demonstration of a cited answer](assets/screenshots/clip-assistant-answer.webm)
-
-
-
+## 1. Getting started
Check [what Loom includes](getting-started/whats-included.md), run the
[quickstart](getting-started/quickstart.md), and [configure models and API keys](getting-started/models-and-keys.md).
-
-
-
+## 2. Install and run the server
Choose a [deployment](operations/deployment.md), configure [single sign-on](operations/sso.md),
and use the [operations guides](operations/index.md) to run Loom day to day.
-
-
-
+## 3. Connect agents
[Connect a coding agent](getting-started/connect-a-coding-agent.md) or choose an
[integration](features/integrations/index.md) for your editor, MCP client, or framework.
-
-
-
+## 4. SDK and API
Find client libraries, commands, and wire contracts in the [reference](reference/index.md).
-
-
-
+## 5. Namespaces, access and the memory model
Read how Loom scopes [identities and namespaces](concepts/identities-and-namespaces.md),
stores [agent memory](concepts/memory.md), and [ranks retrieval results](concepts/retrieval-and-ranking.md).
Use [tokens and grants](guides/tokens-and-grants.md) to set access.
-
-
-
-
## Guides
Use the [guides](guides/index.md) for tasks such as connecting an agent, comparing memory
@@ -84,18 +70,12 @@ setups, and tracing a long run.
The [features index](features/index.md) covers memory, documents, code, work records,
and access and audit controls.
-
-
-
+## 6. Code index
Start with the [code-index overview](features/code-index/overview.md), add a
[repository](features/code-index/repositories.md), and check its
[indexing status](features/code-index/freshness.md).
-
-
-
-
## Architecture
Read the [system overview](architecture/system-overview.md),
diff --git a/docs/scripts/prepare-content.mjs b/docs/scripts/prepare-content.mjs
index 3100d0c615..a97b183c4f 100644
--- a/docs/scripts/prepare-content.mjs
+++ b/docs/scripts/prepare-content.mjs
@@ -346,20 +346,31 @@ async function prepareContent() {
const linked = localized ? prepareTranslatedMarkup(text, englishSources) : text;
const rendered = localized && sourcePath === "index.md" ? prepareLocalizedLandingDemo(linked) : linked;
const original = localized ? `i18n/${locale}/docs/${sourcePath}` : `docs/${preparedPath}`;
- const prepared = withContentMetadata(normalizeTranslatedTitle(rendered, localizedSeo[sourcePath]?.[locale]), {
+ let prepared = withContentMetadata(normalizeTranslatedTitle(rendered, localizedSeo[sourcePath]?.[locale]), {
date: contentDates.get(original),
locale: localized ? locale : "en",
});
+ prepared = staleTranslationNotice(
+ prepared,
+ sourceForTranslation(relative(content, file)),
+ englishRoute(relative(content, file)),
+ );
if (prepared !== text) writeFileSync(file, prepared);
}
- promoteComponentPages();
+ promoteProcedurePages();
const packagePath = fileURLToPath(import.meta.resolve("blume/package.json"));
const codemod = join(dirname(packagePath), "skills", "blume-migrate", "scripts", "mkdocs-codemod.mjs");
- const result = spawnSync(process.execPath, [codemod, "--write", content], {
- cwd: dirname(root),
- stdio: "inherit",
- });
+ const stagedLocales = stageLocales();
+ let result;
+ try {
+ result = spawnSync(process.execPath, [codemod, "--write", content], {
+ cwd: dirname(root),
+ stdio: "inherit",
+ });
+ } finally {
+ restoreLocales(stagedLocales);
+ }
if (result.status !== 0) process.exit(result.status ?? 1);
if (!existsSync(join(content, "index.md")) && !existsSync(join(content, "index.mdx"))) {
@@ -426,6 +437,27 @@ export function prepareLocalizedLandingDemo(text) {
});
}
+/** Keep generated locale pages as inert Markdown while the English codemod runs. */
+function stageLocales() {
+ const staging = join(root, ".blume-locales");
+ rmSync(staging, { recursive: true, force: true });
+ mkdirSync(staging);
+ const staged = [];
+ for (const locale of locales) {
+ const source = join(content, locale);
+ if (!existsSync(source)) continue;
+ const destination = join(staging, locale);
+ renameSync(source, destination);
+ staged.push([source, destination]);
+ }
+ return staged;
+}
+
+function restoreLocales(staged) {
+ for (const [source, destination] of staged) renameSync(destination, source);
+ rmSync(join(root, ".blume-locales"), { recursive: true, force: true });
+}
+
function contentFiles(directory) {
return readdirSync(directory).flatMap((name) => {
const path = join(directory, name);
@@ -486,16 +518,38 @@ export function prepareTranslatedMarkup(text, englishSources) {
}
/** Blume content components are available in MDX pages, not Markdown pages. */
-function promoteComponentPages() {
+function promoteProcedurePages() {
for (const file of contentFiles(content)) {
if (!file.endsWith(".md")) continue;
const text = readFileSync(file, "utf8");
- if (!/<\/?(?:Steps|Step)(?:\s|>)/.test(text)) continue;
- writeFileSync(file, escapeMdxPlaceholders(text));
+ if (locales.includes(relative(content, file).split("/", 1)[0])) continue;
+ const prepared = procedureMdx(text);
+ if (prepared === text) continue;
+ writeFileSync(file, escapeMdxPlaceholders(prepared));
renameSync(file, `${file.slice(0, -3)}.mdx`);
}
}
+/** Render one contiguous numbered procedure as Blume's Steps component. */
+export function procedureMdx(text) {
+ const headings = [...text.matchAll(/^## (?:(\d+)\. (.+)|.*)$/gm)];
+ const first = headings.findIndex((heading) => heading[1]);
+ if (first === -1) return text;
+
+ let last = first;
+ while (last + 1 < headings.length && headings[last + 1][1]) last += 1;
+ const procedure = headings.slice(first, last + 1);
+ const end = headings[last + 1]?.index ?? text.length;
+ let result = `${text.slice(0, procedure[0].index)}\n\n`;
+ for (let index = 0; index < procedure.length; index += 1) {
+ const heading = procedure[index];
+ const bodyStart = heading.index + heading[0].length;
+ const bodyEnd = procedure[index + 1]?.index ?? end;
+ result += `${text.slice(bodyStart, bodyEnd)}\n\n`;
+ }
+ return `${result}\n\n${text.slice(end)}`;
+}
+
/** Escape uppercase Markdown placeholders that MDX would otherwise parse as JSX tags. */
export function escapeMdxPlaceholders(text) {
let fenced = false;
@@ -533,6 +587,38 @@ export function normalizeTranslatedTitle(text, seo = {}) {
return `---\ntitle: ${JSON.stringify(title)}${searchMetadata}\n---\n\n${lines.join("\n")}`;
}
+const STAMP = //;
+
+function sourceForTranslation(from) {
+ const [locale, ...source] = from.split("/");
+ if (!locales.includes(locale)) return null;
+ const path = source.join("/");
+ const english = join(root, path);
+ return existsSync(english) ? readFileSync(english, "utf8") : null;
+}
+
+function englishRoute(from) {
+ const [locale, ...source] = from.split("/");
+ if (!locales.includes(locale)) return "";
+ return `/docs/${source.join("/").replace(/\.md$/, "/")}`;
+}
+
+function gitBlob(text) {
+ return createHash("sha1")
+ .update(`blob ${Buffer.byteLength(text)}\0`)
+ .update(text)
+ .digest("hex");
+}
+
+/** Mark published translations whose stamped English source differs from this build's source. */
+export function staleTranslationNotice(text, english, url) {
+ if (english === null) return text;
+ const stamp = text.match(STAMP);
+ if (!stamp || stamp[2] === gitBlob(english)) return text;
+ const notice = "> **Translation notice:** The English source has changed. Read the [English page](" + url + ").";
+ return text.replace(stamp[0], `${stamp[0]}\n\n${notice}\n`);
+}
+
export function rewriteSourceLinks(text, from) {
const [locale, ...sourceParts] = from.split("/");
const sourceFrom = locales.includes(locale) ? sourceParts.join("/") : from;
@@ -543,6 +629,11 @@ export function rewriteSourceLinks(text, from) {
if (/^\s*(```|~~~)/.test(line)) fenced = !fenced;
if (fenced) return line;
return line.replace(/(!?\[[^\]]*\]\()([^\s)]+)(\))/g, (whole, prefix, target, suffix) => {
+ const generated = {
+ "https://github.com/ClickHouse/loom/blob/main/llms.txt": "/docs/llms.txt",
+ "https://github.com/ClickHouse/loom/blob/main/llms-full.txt": "/docs/llms-full.txt",
+ }[target];
+ if (generated) return `${prefix}${generated}${suffix}`;
if (/^(?:[a-z]+:|\/|#)/i.test(target)) return whole;
const [path, anchor] = target.split("#", 2);
const resolved = normalize(join(dirname(sourceFrom), decodeURIComponent(path))).replaceAll("\\", "/");
diff --git a/docs/scripts/prepare-content.test.mjs b/docs/scripts/prepare-content.test.mjs
index dc708c2380..ab1a5404f0 100644
--- a/docs/scripts/prepare-content.test.mjs
+++ b/docs/scripts/prepare-content.test.mjs
@@ -8,7 +8,9 @@ import {
normalizeTranslatedTitle,
prepareLocalizedLandingDemo,
prepareTranslatedMarkup,
+ procedureMdx,
rewriteSourceLinks,
+ staleTranslationNotice,
} from "./prepare-content.mjs";
test("defers the localized landing demo and uses the published media file", () => {
@@ -158,6 +160,28 @@ test("escapes uppercase placeholders without rewriting HTML", () => {
assert.equal(escapeMdxPlaceholders(source), expected);
});
+test("renders numbered source sections as Steps only in prepared content", () => {
+ const source =
+ "# Quickstart\n\nIntro.\n\n## 1. Boot the stack\n\nRun it.\n\n## 2. Open the dashboard\n\nOpen it.\n\n## Optional\n\nMore.\n";
+ const expected =
+ '# Quickstart\n\nIntro.\n\n\n\n\n\nRun it.\n\n\n\n\n\nOpen it.\n\n\n\n\n\n## Optional\n\nMore.\n';
+
+ assert.equal(procedureMdx(source), expected);
+});
+
+test("marks a stale translation after its stamped source comment", () => {
+ const source = "# Quickstart\n";
+ const translation =
+ "\n" +
+ "# Inicio rápido\n";
+
+ assert.equal(
+ staleTranslationNotice(translation, source, "/docs/getting-started/quickstart/"),
+ "\n\n" +
+ "> **Translation notice:** The English source has changed. Read the [English page](/docs/getting-started/quickstart/).\n\n# Inicio rápido\n",
+ );
+});
+
test("keeps translated repository links outside the docs site", () => {
const source = "[README](../../README.md)\n";
const expected = "[README](https://github.com/ClickHouse/loom/blob/main/README.md)\n";
@@ -203,3 +227,33 @@ test("keeps a translated multiline code span on one line for link validation", (
const expected = 'Some HTML syntax `