Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
af2cbed
Add a bounded outbound MCP read client
zlareb1 Nov 22, 2026
846942b
MCP cancellation drains its SDK session
zlareb1 Nov 22, 2026
c36be95
Drain terminal MCP requests before returning
zlareb1 Nov 22, 2026
4dc7c27
Disable external schema retrieval and close unclaimed responses
zlareb1 Nov 22, 2026
28d8533
Refuse MCP results after terminal transport failures
zlareb1 Nov 22, 2026
e864d7c
Refuse unexpected MCP responses before protocol handoff
zlareb1 Nov 22, 2026
b13c0aa
Bind MCP credential origins to the dispatched hostname
zlareb1 Nov 23, 2026
1702f99
Preserve MCP source identity through owner cleanup and restore
zlareb1 Nov 23, 2026
6fc9ba9
Bound historical generations and normalize source identities
zlareb1 Nov 23, 2026
c84526e
Add MCP profile and destination setup primitives
zlareb1 Nov 23, 2026
9aae4db
Keep restore recovery within the admitted registration limit
zlareb1 Nov 23, 2026
0b6e511
Admit bounded standard MCP schemas and explicit result formats
zlareb1 Nov 23, 2026
b5a9fab
Prepare owner-scoped MCP connection operations and generated clients
zlareb1 Nov 23, 2026
ca796ee
Bind SCIM lifecycle tests to their strict source inventory store
zlareb1 Nov 23, 2026
e9d2e2e
Apply configured MCP contract admission limits
zlareb1 Nov 23, 2026
f22f5f1
Read selected MCP resources through guarded knowledge writes
zlareb1 Nov 23, 2026
8a7865d
Explain selected MCP source access before publication
zlareb1 Nov 23, 2026
1094ea2
Export the generated analyzer manifest after a stale-shape failure
zlareb1 Nov 23, 2026
0d90d7c
Export the generated operation reach manifest after a failed check
zlareb1 Nov 23, 2026
bdd5f2e
Bind selected sources to owner publication authority
zlareb1 Nov 23, 2026
5a69793
Bind selected document reads to current source authority
zlareb1 Nov 23, 2026
730f509
Regenerate lifecycle statement shapes
zlareb1 Nov 23, 2026
d95fb2f
Cancel queued notifications during normal MCP shutdown
zlareb1 Nov 23, 2026
a10c9e1
Execute selected document sources through MCP
zlareb1 Nov 23, 2026
401db50
Protect source retrieval across clients and setup controls
zlareb1 Nov 23, 2026
5c6d149
Exercise private source reads across installed CLI commands
zlareb1 Nov 23, 2026
7b28527
Protect Java source requests with retained session authority
zlareb1 Nov 23, 2026
8f4ab13
Protect Go source requests across retained client contexts
zlareb1 Nov 23, 2026
3d9ac24
Check source SDK contracts in hosted qualification
zlareb1 Nov 23, 2026
1a1f49d
Describe MCP source authority and retained native registrations
zlareb1 Nov 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
87 changes: 87 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,22 @@ jobs:
# server/operations/reach_manifest.py are generated too; the unit suite
# checks them, this step fails faster.
- name: docs reference and reach manifest are current
id: generated-references
run: |
python scripts/codegen/settings_reference.py --check
python scripts/codegen/settings_schema.py --check
python scripts/codegen/docs_reference.py --check
python scripts/codegen/op_reach_census.py --check
- name: Render reach manifest candidate after a generated-reference failure
if: failure() && steps.generated-references.outcome == 'failure'
run: python scripts/codegen/op_reach_census.py --write-manifest
- name: Upload reach manifest candidate
if: failure() && steps.generated-references.outcome == 'failure'
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: generated-reach-manifest
path: server/operations/reach_manifest.py
if-no-files-found: error
# The SDK ships py.typed: it is type-checked strictly
# on its own, apart from the server's ratchet below.
- name: mypy --strict on the Python SDK
Expand Down Expand Up @@ -175,6 +186,8 @@ jobs:
run: |
uv sync --locked --python "${{ steps.python.outputs.python-path }}" --extra dev --extra code
echo "$PWD/.venv/bin" >> "$GITHUB_PATH"
- name: Install the maintained Python SDK for its unit request contracts
run: uv pip install --no-deps -e sdk/python
- name: Fetch origin/main for the migration-number check
run: git fetch --no-tags --depth=1 origin +refs/heads/main:refs/remotes/origin/main
# The clickhouse binary (as clickhouse-local and clickhouse-format) for the
Expand Down Expand Up @@ -428,6 +441,7 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
fetch-depth: 2
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: ${{ env.NODE_VERSION }}
Expand All @@ -447,6 +461,43 @@ jobs:
run: npx --yes @taplo/cli@0.7.0 format --check
- name: shfmt
run: git ls-files '*.sh' ':!tests/fixtures' | xargs shfmt -d
- name: Render changed-source formatting candidate after failure
if: failure()
run: |
python3 - <<'PY'
import os
import subprocess
from pathlib import Path

changed = subprocess.check_output([
"git", "diff", "-z", "--name-only", "--diff-filter=ACMR", "HEAD^1", "HEAD"
], text=True).split("\0")
selected = [p for p in changed if p.endswith((".ts", ".tsx", ".md", ".yml", ".yaml"))]
if len(selected) > 512 or any(Path(p).is_symlink() for p in selected):
raise SystemExit("Formatting candidate scope refused")
for suffixes, command in (
((".ts", ".tsx"), ["npx", "--yes", "@biomejs/biome@2.5.14", "format", "--write"]),
((".md", ".yml", ".yaml"), ["npx", "--yes", "prettier@3.9.9", "--write", "--log-level", "warn"]),
):
files = [p for p in selected if p.endswith(suffixes)]
for offset in range(0, len(files), 32):
subprocess.run([
*command, *[str(Path(p).resolve()) for p in files[offset:offset + 32]]
], check=True)
patch = subprocess.check_output([
"git", "diff", "--no-ext-diff", "--unified=3", "--", *selected
]) if selected else b""
if len(patch) > 32 * 1024 * 1024:
raise SystemExit("Formatting candidate size refused")
Path(os.environ["RUNNER_TEMP"], "format-candidate.patch").write_bytes(patch)
PY
- name: Upload formatting candidate
if: failure()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: changed-source-format-candidate
path: ${{ runner.temp }}/format-candidate.patch
if-no-files-found: error

helm:
needs: validate-ref
Expand Down Expand Up @@ -913,8 +964,19 @@ jobs:
# with the builders. ~10 s; a rejection here is a statement that would
# fail on a deployed server.
- name: analyzer statement corpus
id: analyzer-corpus
if: matrix.part == 'isolation' && steps.migrate.outcome == 'success' && !cancelled()
run: pytest tests/analyzer -q
- name: Render analyzer manifest candidate after a failed corpus check
if: failure() && steps.analyzer-corpus.outcome == 'failure'
run: python -m tests.analyzer.corpus --write
- name: Upload analyzer manifest candidate
if: failure() && steps.analyzer-corpus.outcome == 'failure'
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: generated-analyzer-shapes
path: tests/analyzer/shapes.txt
if-no-files-found: error
- name: Upload server log on failure
if: failure()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
Expand Down Expand Up @@ -1033,6 +1095,7 @@ jobs:
tests/integration/test_knowledge_ingest_queue.py
tests/integration/test_knowledge_sharing.py
tests/integration/test_knowledge_restore.py
tests/integration/test_mcp_source_lifecycle_ch.py
tests/integration/test_restored_memory_ids.py
tests/integration/test_memory_import.py
tests/integration/test_cross_principal_leakage.py
Expand Down Expand Up @@ -1292,7 +1355,20 @@ jobs:
- name: Resolve dependencies for this toolchain
run: cargo generate-lockfile
- name: Rust formatting
id: rust-format
run: cargo fmt --check
- name: Render Rust formatting candidate after failure
if: failure() && steps.rust-format.outcome == 'failure'
run: |
cargo fmt
git diff --no-ext-diff --unified=3 -- '*.rs' > "$RUNNER_TEMP/rust-format-candidate.patch"
- name: Upload Rust formatting candidate
if: failure() && steps.rust-format.outcome == 'failure'
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: rust-format-${{ matrix.rust }}
path: ${{ runner.temp }}/rust-format-candidate.patch
if-no-files-found: error
- name: Unit, HTTP contract and documentation tests
run: cargo test --locked
- name: Lint the library, tests and examples
Expand Down Expand Up @@ -1335,7 +1411,18 @@ jobs:
# server's registry; a server change that alters a
# request or response shape must regenerate them in the same PR.
- name: generated ops.ts is current
id: generated-ts
run: python scripts/codegen/sdk_ts_gen.py --check
- name: Render TypeScript contract candidate after failure
if: failure() && steps.generated-ts.outcome == 'failure'
run: python scripts/codegen/sdk_ts_gen.py
- name: Upload TypeScript contract candidate
if: failure() && steps.generated-ts.outcome == 'failure'
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: generated-typescript-contract
path: sdk/typescript/src/generated/ops.ts
if-no-files-found: error
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: ${{ env.NODE_VERSION }}
Expand Down
158 changes: 158 additions & 0 deletions .github/workflows/mcp-source-lifecycle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
name: MCP source lifecycle

on:
pull_request:
paths:
- .github/workflows/mcp-source-lifecycle.yml
- scripts/gates/mcp_source_lifecycle.py
- server/knowledge/**
- server/erasure/app/connected_accounts.py
- server/erasure/store/census.py
- server/auth/claims.py
- server/core/**
- server/cli/_ch.py
- schemas/**
- dev/ci_start_clickhouse.sh
- dev/ci_start_postgres.sh
- dev/clickhouse_release.sh
- tests/integration/test_mcp_source_lifecycle_ch.py
- pyproject.toml
- uv.lock
workflow_dispatch:

permissions:
contents: read

env:
PYTHON_VERSION: "3.12"
UV_VERSION: "0.12.19"

jobs:
clickhouse:
name: Resolve the ClickHouse release
runs-on: ubuntu-latest
timeout-minutes: 10
outputs:
image: ${{ steps.resolve.outputs.image }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
sparse-checkout: /dev/clickhouse_release.sh
sparse-checkout-cone-mode: false
- id: resolve
run: |
image=$(bash dev/clickhouse_release.sh)
echo "image=$image" >> "$GITHUB_OUTPUT"

restore:
name: Offline source restore (${{ matrix.authority }})
needs: clickhouse
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
include:
- authority: clickhouse
pg_dsn: ""
- authority: postgres
pg_dsn: postgres://loom:loomdev@127.0.0.1:5432/loom
env:
LOOM_CLICKHOUSE_IMAGE: ${{ needs.clickhouse.outputs.image }}
LOOM_CH_CONTAINER: loom-mcp-lifecycle-ch
LOOM_CH_HOST: 127.0.0.1
LOOM_CH_PORT: "8123"
LOOM_CH_USER: loom
LOOM_CH_READER_USER: loom_reader
LOOM_CH_PASSWORD: loomdev
LOOM_CH_DATABASE: loom
LOOM_CH_SECURE: "false"
LOOM_PG_CONTAINER: loom-mcp-lifecycle-pg
LOOM_PG_IMAGE: postgres:16
LOOM_PG_STANDBY: "1"
LOOM_PG_DSN: ${{ matrix.pg_dsn }}
LOOM_STORAGE_AUTHORITY: ${{ matrix.authority }}
LOOM_AUTH_REQUIRED: "false"
LOOM_JWT_SECRET: ci-only-mcp-lifecycle-fixture
LOOM_LLM_PROVIDER: fake
LOOM_EMBEDDING_MODEL: fake-ngram-1024
LOOM_BACKGROUND_WORKERS: "off"
LOOM_BOOT_MIGRATE: "true"
LOOM_ENV_FILE: ""
LOOM_MCP_SOURCE_LIFECYCLE_FIXTURE: offline-isolated
LOOM_KNOWLEDGE_CONNECTED_REGISTRY_SCAN_LIMIT: "8"
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
sparse-checkout: |
server
scripts
schemas
dev
deploy
sdk
extractor
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
id: python
with:
python-version: ${{ env.PYTHON_VERSION }}
- uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
with:
version: ${{ env.UV_VERSION }}
enable-cache: true
cache-dependency-glob: uv.lock
- name: Install the locked development dependencies
run: |
uv sync --locked --python "${{ steps.python.outputs.python-path }}" --extra dev --extra code
echo "$PWD/.venv/bin" >> "$GITHUB_PATH"
- name: Refuse preexisting fixture containers
run: |
for container in "$LOOM_CH_CONTAINER" "$LOOM_PG_CONTAINER" "$LOOM_PG_CONTAINER-standby"; do
if docker container inspect "$container" >/dev/null 2>&1; then
echo "fixture container already exists"
exit 1
fi
done
- name: Start the owned ClickHouse with Keeper
id: clickhouse
run: bash dev/ci_start_clickhouse.sh
- name: Start the owned synchronous Postgres fixture
id: postgres
if: matrix.authority == 'postgres'
run: bash dev/ci_start_postgres.sh
- name: Apply the normal ClickHouse migration journal
run: python -m server.core.schema.migrate
# The script initializes/verifies the selected authority; it starts no service or worker.
- name: Qualify full offline source restoration
run: >-
python -m scripts.gates.mcp_source_lifecycle --isolated-fixture
--result "$RUNNER_TEMP/mcp-source-lifecycle-${{ matrix.authority }}.json"
- name: Upload the bounded redacted qualification result
if: always()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: mcp-source-lifecycle-${{ matrix.authority }}
path: ${{ runner.temp }}/mcp-source-lifecycle-${{ matrix.authority }}.json
if-no-files-found: error
retention-days: 7
- name: Stop only this job's fixture containers
if: always()
run: |
cleanup_status=0
stop_owned() {
if docker container inspect "$1" >/dev/null 2>&1; then
docker stop --time 10 "$1" || cleanup_status=1
elif [ "$2" = 'success' ]; then
cleanup_status=1
fi
}
if [ '${{ steps.clickhouse.outcome }}' != 'skipped' ] && [ '${{ steps.clickhouse.outcome }}' != '' ]; then
stop_owned "$LOOM_CH_CONTAINER" '${{ steps.clickhouse.outcome }}'
fi
if [ '${{ steps.postgres.outcome }}' != 'skipped' ] && [ '${{ steps.postgres.outcome }}' != '' ]; then
stop_owned "$LOOM_PG_CONTAINER-standby" '${{ steps.postgres.outcome }}'
stop_owned "$LOOM_PG_CONTAINER" '${{ steps.postgres.outcome }}'
fi
exit "$cleanup_status"
Loading
Loading