Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

fix: register sources_resolve_path in the op ledgers and sweeps; regenerate contract and doctor goldens; keep readShadowLevel under 300 lines

garrytanec3d84ed26f5
diff --git a/docs/TOOL_CATALOG.md b/docs/TOOL_CATALOG.md
index 5958d57b16..b8ccb24436 100644
--- a/docs/TOOL_CATALOG.md
+++ b/docs/TOOL_CATALOG.md
@@ -4,7 +4,7 @@
<!-- Regenerate: bun run scripts/generate-tool-catalog.ts -->
<!-- Freshness-guarded by scripts/check-tool-catalog-fresh.sh (bun run verify). -->
-Every non-localOnly operation on the MCP surface: 158 tools across 26 areas. **Starter** marks membership in the ~40-op `starter` surface (`src/mcp/surface.ts`); **Gate** names the config key that must be true before remote callers see/call the op (`gbrain config set <key> true`). What a given token actually sees is further filtered per request by scope, bound-client fence, publish gates, and the per-client surface — see `docs/operations/mcp-surface-runbook.md`. Area names are non-contractual groupings.
+Every non-localOnly operation on the MCP surface: 158 tools across 25 areas. **Starter** marks membership in the ~40-op `starter` surface (`src/mcp/surface.ts`); **Gate** names the config key that must be true before remote callers see/call the op (`gbrain config set <key> true`). What a given token actually sees is further filtered per request by scope, bound-client fence, publish gates, and the per-client surface — see `docs/operations/mcp-surface-runbook.md`. Area names are non-contractual groupings.
## admin
@@ -164,12 +164,6 @@ Every non-localOnly operation on the MCP surface: 158 tools across 26 areas. **S
| `ontology_get` | Life Chronicle: the current resolved per-entity ontology (dimension → value) at `asof` (default now), with provenance + confidence + validity. | read | | |
| `ontology_propose` | Life Chronicle: record one ontology observation (entity has dimension=value), sourced + confidence-weighted + bi-temporal. | write | | |
-## other
-
-| Tool | Description | Scope | Starter | Gate |
-|---|---|---|---|---|
-| `sources_resolve_path` | Read-only: what gbrain did with each file path of a source, by its own rules. | read | | |
-
## pages
| Tool | Description | Scope | Starter | Gate |
@@ -263,6 +257,7 @@ Every non-localOnly operation on the MCP surface: 158 tools across 26 areas. **S
| `sources_add` | Register a new source. | sources_admin | | |
| `sources_list` | List registered sources with page counts and remote_url. | read | | |
| `sources_remove` | Hard-remove a source (cascades pages/chunks/embeddings). | sources_admin | | |
+| `sources_resolve_path` | Read-only: what gbrain did with each file path of a source, by its own rules. | read | | |
| `sources_status` | Per-source diagnostic. | read | | |
## tags
diff --git a/src/core/eligibility/registry.ts b/src/core/eligibility/registry.ts
index 4c2430d5d7..d715fcfadf 100644
--- a/src/core/eligibility/registry.ts
+++ b/src/core/eligibility/registry.ts
@@ -46,7 +46,7 @@ export const OP_READ_TRUST: Readonly<Record<string, ReadTrustHandling>> = {
search_modes: 'text_free', list_link_sources: 'text_free', get_brain_identity: 'text_free',
list_skills: 'text_free', get_skill: 'text_free', list_brain_skillpack: 'text_free', advisor: 'text_free',
get_skill_asset: 'text_free', join_brain: 'text_free', sync_brain_skills: 'text_free', leave_brain: 'text_free',
- get_calibration_profile: 'text_free', whoami: 'text_free', sources_list: 'text_free', sources_status: 'text_free',
+ get_calibration_profile: 'text_free', whoami: 'text_free', sources_list: 'text_free', sources_status: 'text_free', sources_resolve_path: 'text_free',
sources_inspect: 'text_free', request_tools: 'text_free', connectors_status: 'text_free',
get_active_schema_pack: 'text_free', list_schema_packs: 'text_free', schema_stats: 'text_free', schema_lint: 'text_free',
schema_graph: 'text_free', schema_explain_type: 'text_free',
diff --git a/src/core/operation-load.ts b/src/core/operation-load.ts
index ef2ebfd745..901de8b783 100644
--- a/src/core/operation-load.ts
+++ b/src/core/operation-load.ts
@@ -71,7 +71,7 @@ const OP_AREAS: Record<string, string> = {
advisor: 'advisor',
// sources
sources_add: 'sources', sources_list: 'sources', sources_remove: 'sources',
- sources_status: 'sources',
+ sources_status: 'sources', sources_resolve_path: 'sources',
// sync (localOnly)
sync_brain: 'sync',
// ingest log
diff --git a/src/core/operation-manifest.generated.ts b/src/core/operation-manifest.generated.ts
index 4642f3d9ea..2fe51c18b9 100644
--- a/src/core/operation-manifest.generated.ts
+++ b/src/core/operation-manifest.generated.ts
@@ -4531,7 +4531,8 @@ export const OPERATION_MANIFEST: OperationMeta[] = [
"cliHints": {
"name": "sources_resolve_path",
"hidden": true
- }
+ },
+ "area": "sources"
},
{
"name": "request_tools",
diff --git a/src/core/persistence/sync-pass.ts b/src/core/persistence/sync-pass.ts
index dcea74e099..9c0c88c76e 100644
--- a/src/core/persistence/sync-pass.ts
+++ b/src/core/persistence/sync-pass.ts
@@ -35,7 +35,7 @@ import { confirmedSyncDelta } from '../sync-rename-identity.ts';
import { holdBasisMoved, holdRescreenDue, readGitHoldRetryPaths, readGitSourceHolds, SYNC_IMPORT_PROVENANCE_OP, syncImportParser, syncImportParsers,
type GitHoldRecord, type SyncImportParser, type SyncImportProvenance } from './sync-holds.ts';
import { movedDriftHolds, sameParser } from './sync-prescreen.ts';
-import { sameSyncOrigin, selectOriginClaimant, syncOriginPath } from './sync-origin.ts';
+import { sameSyncOrigin, selectOriginClaimant, syncOriginPath, type SyncOriginScope } from './sync-origin.ts';
import { hashWorkingLevel, probeDirtiness, readBlobs, readIndexDelta, readIndexLevel, readTreeLevel, workingChanged, type GitIndexEntry, type GitTreeEntry, type WorkingStatCache } from './sync-git-stream.ts';
import { readOriginEvidence } from './sync-origin-evidence.ts';
import { classifySyncPath, syncPassKind, type SyncClassified, type SyncIdleBlocker, type SyncPathState } from './sync-classify.ts';
@@ -612,12 +612,7 @@ export async function readShadowLevel(engine: BrainEngine, input: { sourceId: st
// #5610: a source-root page whose stored origin is the legacy Git-root spelling (`<scope>/<origin>`) names `<origin>`, by
// the one rule discovery and preparation use (sameSyncOrigin; it refuses an origin that could name two files).
const originScope = { sourceId, root, scope, slugMode };
- const pageOrigin = (sourcePath: string, slug: string): string => {
- const recorded = originPath(sourcePath);
- if (slugMode !== 'source-root' || !scope || !recorded.startsWith(`${scope}/`)) return recorded;
- const stripped = recorded.slice(scope.length + 1);
- return sameSyncOrigin(recorded, stripped, originScope, slug) ? stripped : recorded;
- };
+ const pageOrigin = (sourcePath: string, slug: string): string => scopedPageOrigin(originPath(sourcePath), slug, originScope);
const step = turnYield();
t = timer();
@@ -886,6 +881,14 @@ export async function readShadowLevel(engine: BrainEngine, input: { sourceId: st
rescreenDue: holds.filter(hold => holdRescreenDue(hold, retry.has(hold.path))).map(hold => toGit(hold.path)), workingCache: hashed?.cache ?? null };
}
+/** A recorded page origin as the level names it: a source-root page's legacy Git-root spelling loses its scope (#5610). */
+function scopedPageOrigin(recorded: string, slug: string, originScope: SyncOriginScope): string {
+ const { scope, slugMode } = originScope;
+ if (slugMode !== 'source-root' || !scope || !recorded.startsWith(`${scope}/`)) return recorded;
+ const stripped = recorded.slice(scope.length + 1);
+ return sameSyncOrigin(recorded, stripped, originScope, slug) ? stripped : recorded;
+}
+
/** The level's settings, one round trip each and all in flight together; null for a company-brain source. */
async function readLevelSettings(engine: BrainEngine, context: ManagedSyncContext, scope: string, input: { workingTree?: boolean; pass?: PassLevelInput }) {
const { sourceId, root } = context;
diff --git a/test/fixtures/goldens/cli/tools-json.json b/test/fixtures/goldens/cli/tools-json.json
index fc9e438d91..24e2a052d4 100644
--- a/test/fixtures/goldens/cli/tools-json.json
+++ b/test/fixtures/goldens/cli/tools-json.json
@@ -2,8 +2,8 @@
"golden": {
"exitCode": 0,
"stderr": "",
- "stdoutBytes": 252798,
- "stdoutSha256": "71b348f0e16ec33eeb7b856a2fa24821a5f971503416d541e00226572381ab56",
+ "stdoutBytes": 254064,
+ "stdoutSha256": "570a69118ce503b1de5ee75ad60f666b4ac65ed826fab045526187780529fc08",
"toolNames": [
"remember",
"entity",
@@ -120,6 +120,7 @@
"sources_remove",
"sources_status",
"sources_inspect",
+ "sources_resolve_path",
"request_tools",
"get_recent_salience",
"find_anomalies",
@@ -5425,6 +5426,39 @@
},
"scope": "read"
},
+ {
+ "description": "Read-only: what gbrain did with each file path of a source, by its own rules. Per path: the slug sync gives it, whether sync skips it (metafile, excluded, pruned) and why, its sync hold, its page with chunk and embedding counts, whether search finds it now, and the command that moves it on. A deleted path is checked by the page that records it as its origin, never by slug. Use it in landing checks instead of re-implementing slugging. Confined to the caller's source scope.",
+ "idempotent": true,
+ "local_only": false,
+ "mutating": false,
+ "name": "sources_resolve_path",
+ "parameters": {
+ "id": "string",
+ "paths": "array"
+ },
+ "required_scopes": [],
+ "schema": {
+ "properties": {
+ "id": {
+ "description": "Source id, as listed by sources_list (e.g. 'default').",
+ "type": "string"
+ },
+ "paths": {
+ "description": "File paths relative to the source root (or to the Git top level), at most 200, e.g. the paths a commit changed.",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ }
+ },
+ "required": [
+ "id",
+ "paths"
+ ],
+ "type": "object"
+ },
+ "scope": "read"
+ },
{
"description": "More tools: no arguments lists your catalog; {tools: [names]} returns schemas; {surface} widens it (per client or stdio session).",
"idempotent": false,
diff --git a/test/fixtures/goldens/doctor/content-pglite-human.json b/test/fixtures/goldens/doctor/content-pglite-human.json
index adffb10a87..1e94de13dd 100644
--- a/test/fixtures/goldens/doctor/content-pglite-human.json
+++ b/test/fixtures/goldens/doctor/content-pglite-human.json
@@ -65,6 +65,7 @@
" [INFO] embedding_state: Embedding state (exact, column 'embedding'): 0 embedded, 7 pending, 0 keyword-only, 0 quarantined, 0 empty, 0 on deleted pages, 0 chunkless (healable); 0 unsearchable. Embeddings are disabled by choice: keyword search reads the pending chunks.",
" [OK] links_extraction_lag: Extraction lag not applicable (5 pages — too few to assess)",
" [OK] partial_embedding: No large page has chunks waiting for embedding approval (held or capped by embed.max_usd_per_page).",
+ " [OK] sync_landing_gaps: Every page managed sync committed past its freshness target in the last 24 h is searchable.",
" [OK] pgvector: Extension installed",
" [OK] pages_upsert_arbiter: pages has the UNIQUE(source_id, slug) upsert arbiter",
" [OK] text_projection_readiness: Visible text projections match their canonical revisions.",
diff --git a/test/fixtures/goldens/doctor/content-pglite-json.json b/test/fixtures/goldens/doctor/content-pglite-json.json
index 3dbf05aabc..ac10bf83df 100644
--- a/test/fixtures/goldens/doctor/content-pglite-json.json
+++ b/test/fixtures/goldens/doctor/content-pglite-json.json
@@ -859,6 +859,40 @@
"name": "partial_embedding",
"status": "ok"
},
+ {
+ "category": "brain",
+ "details": {
+ "docs": "docs/guides/resolve-paths.md#synced-but-not-searchable",
+ "sources": [
+ {
+ "after_seconds": 300,
+ "by_state": {},
+ "checked": 0,
+ "complete": true,
+ "gaps": 0,
+ "pages": [],
+ "source_id": "default",
+ "status": "ok",
+ "window_hours": 24
+ },
+ {
+ "after_seconds": 300,
+ "by_state": {},
+ "checked": 0,
+ "complete": true,
+ "gaps": 0,
+ "pages": [],
+ "source_id": "notes",
+ "status": "ok",
+ "window_hours": 24
+ }
+ ]
+ },
+ "elapsed_ms": "<volatile>",
+ "message": "Every page managed sync committed past its freshness target in the last 24 h is searchable.",
+ "name": "sync_landing_gaps",
+ "status": "ok"
+ },
{
"category": "ops",
"elapsed_ms": "<volatile>",
@@ -2435,6 +2469,7 @@
"on_commit": false,
"sources": [
{
+ "behind": null,
"commit_to_embedded": {
"p50_seconds": null,
"p95_seconds": null,
@@ -2452,6 +2487,7 @@
"window_hours": 24
},
{
+ "behind": null,
"commit_to_embedded": {
"p50_seconds": null,
"p95_seconds": null,
diff --git a/test/fixtures/goldens/doctor/hot-checks-pglite-json.json b/test/fixtures/goldens/doctor/hot-checks-pglite-json.json
index 7b6bb3de80..cdadf1d92a 100644
--- a/test/fixtures/goldens/doctor/hot-checks-pglite-json.json
+++ b/test/fixtures/goldens/doctor/hot-checks-pglite-json.json
@@ -881,6 +881,51 @@
"name": "partial_embedding",
"status": "ok"
},
+ {
+ "category": "brain",
+ "details": {
+ "docs": "docs/guides/resolve-paths.md#synced-but-not-searchable",
+ "sources": [
+ {
+ "after_seconds": 300,
+ "by_state": {},
+ "checked": 0,
+ "complete": true,
+ "gaps": 0,
+ "pages": [],
+ "source_id": "default",
+ "status": "ok",
+ "window_hours": 24
+ },
+ {
+ "after_seconds": 300,
+ "by_state": {},
+ "checked": 0,
+ "complete": true,
+ "gaps": 0,
+ "pages": [],
+ "source_id": "notes",
+ "status": "ok",
+ "window_hours": 24
+ },
+ {
+ "after_seconds": 300,
+ "by_state": {},
+ "checked": 0,
+ "complete": true,
+ "gaps": 0,
+ "pages": [],
+ "source_id": "plain",
+ "status": "ok",
+ "window_hours": 24
+ }
+ ]
+ },
+ "elapsed_ms": "<volatile>",
+ "message": "Every page managed sync committed past its freshness target in the last 24 h is searchable.",
+ "name": "sync_landing_gaps",
+ "status": "ok"
+ },
{
"category": "ops",
"elapsed_ms": "<volatile>",
@@ -2596,6 +2641,7 @@
"on_commit": false,
"sources": [
{
+ "behind": null,
"commit_to_embedded": {
"p50_seconds": null,
"p95_seconds": null,
@@ -2613,6 +2659,10 @@
"window_hours": 24
},
{
+ "behind": {
+ "commits": 0,
+ "oldest_seconds": null
+ },
"commit_to_embedded": {
"p50_seconds": null,
"p95_seconds": null,
@@ -2630,6 +2680,7 @@
"window_hours": 24
},
{
+ "behind": null,
"commit_to_embedded": {
"p50_seconds": null,
"p95_seconds": null,
@@ -5316,6 +5367,51 @@
"name": "partial_embedding",
"status": "ok"
},
+ {
+ "category": "brain",
+ "details": {
+ "docs": "docs/guides/resolve-paths.md#synced-but-not-searchable",
+ "sources": [
+ {
+ "after_seconds": 300,
+ "by_state": {},
+ "checked": 0,
+ "complete": true,
+ "gaps": 0,
+ "pages": [],
+ "source_id": "default",
+ "status": "ok",
+ "window_hours": 24
+ },
+ {
+ "after_seconds": 300,
+ "by_state": {},
+ "checked": 0,
+ "complete": true,
+ "gaps": 0,
+ "pages": [],
+ "source_id": "notes",
+ "status": "ok",
+ "window_hours": 24
+ },
+ {
+ "after_seconds": 300,
+ "by_state": {},
+ "checked": 0,
+ "complete": true,
+ "gaps": 0,
+ "pages": [],
+ "source_id": "plain",
+ "status": "ok",
+ "window_hours": 24
+ }
+ ]
+ },
+ "elapsed_ms": "<volatile>",
+ "message": "Every page managed sync committed past its freshness target in the last 24 h is searchable.",
+ "name": "sync_landing_gaps",
+ "status": "ok"
+ },
{
"category": "ops",
"elapsed_ms": "<volatile>",
@@ -7031,6 +7127,7 @@
"on_commit": false,
"sources": [
{
+ "behind": null,
"commit_to_embedded": {
"p50_seconds": null,
"p95_seconds": null,
@@ -7048,6 +7145,10 @@
"window_hours": 24
},
{
+ "behind": {
+ "commits": 0,
+ "oldest_seconds": null
+ },
"commit_to_embedded": {
"p50_seconds": null,
"p95_seconds": null,
@@ -7065,6 +7166,7 @@
"window_hours": 24
},
{
+ "behind": null,
"commit_to_embedded": {
"p50_seconds": null,
"p95_seconds": null,
diff --git a/test/fixtures/goldens/doctor/hot-checks-postgres-json.json b/test/fixtures/goldens/doctor/hot-checks-postgres-json.json
index 3a374732cd..c7c0425191 100644
--- a/test/fixtures/goldens/doctor/hot-checks-postgres-json.json
+++ b/test/fixtures/goldens/doctor/hot-checks-postgres-json.json
@@ -877,6 +877,51 @@
"name": "partial_embedding",
"status": "ok"
},
+ {
+ "category": "brain",
+ "details": {
+ "docs": "docs/guides/resolve-paths.md#synced-but-not-searchable",
+ "sources": [
+ {
+ "after_seconds": 300,
+ "by_state": {},
+ "checked": 0,
+ "complete": true,
+ "gaps": 0,
+ "pages": [],
+ "source_id": "default",
+ "status": "ok",
+ "window_hours": 24
+ },
+ {
+ "after_seconds": 300,
+ "by_state": {},
+ "checked": 0,
+ "complete": true,
+ "gaps": 0,
+ "pages": [],
+ "source_id": "notes",
+ "status": "ok",
+ "window_hours": 24
+ },
+ {
+ "after_seconds": 300,
+ "by_state": {},
+ "checked": 0,
+ "complete": true,
+ "gaps": 0,
+ "pages": [],
+ "source_id": "plain",
+ "status": "ok",
+ "window_hours": 24
+ }
+ ]
+ },
+ "elapsed_ms": "<volatile>",
+ "message": "Every page managed sync committed past its freshness target in the last 24 h is searchable.",
+ "name": "sync_landing_gaps",
+ "status": "ok"
+ },
{
"category": "ops",
"elapsed_ms": "<volatile>",
@@ -2600,6 +2645,7 @@
"on_commit": false,
"sources": [
{
+ "behind": null,
"commit_to_embedded": {
"p50_seconds": null,
"p95_seconds": null,
@@ -2617,6 +2663,10 @@
"window_hours": 24
},
{
+ "behind": {
+ "commits": 0,
+ "oldest_seconds": null
+ },
"commit_to_embedded": {
"p50_seconds": null,
"p95_seconds": null,
@@ -2634,6 +2684,7 @@
"window_hours": 24
},
{
+ "behind": null,
"commit_to_embedded": {
"p50_seconds": null,
"p95_seconds": null,
@@ -5313,6 +5364,51 @@
"name": "partial_embedding",
"status": "ok"
},
+ {
+ "category": "brain",
+ "details": {
+ "docs": "docs/guides/resolve-paths.md#synced-but-not-searchable",
+ "sources": [
+ {
+ "after_seconds": 300,
+ "by_state": {},
+ "checked": 0,
+ "complete": true,
+ "gaps": 0,
+ "pages": [],
+ "source_id": "default",
+ "status": "ok",
+ "window_hours": 24
+ },
+ {
+ "after_seconds": 300,
+ "by_state": {},
+ "checked": 0,
+ "complete": true,
+ "gaps": 0,
+ "pages": [],
+ "source_id": "notes",
+ "status": "ok",
+ "window_hours": 24
+ },
+ {
+ "after_seconds": 300,
+ "by_state": {},
+ "checked": 0,
+ "complete": true,
+ "gaps": 0,
+ "pages": [],
+ "source_id": "plain",
+ "status": "ok",
+ "window_hours": 24
+ }
+ ]
+ },
+ "elapsed_ms": "<volatile>",
+ "message": "Every page managed sync committed past its freshness target in the last 24 h is searchable.",
+ "name": "sync_landing_gaps",
+ "status": "ok"
+ },
{
"category": "ops",
"elapsed_ms": "<volatile>",
@@ -7036,6 +7132,7 @@
"on_commit": false,
"sources": [
{
+ "behind": null,
"commit_to_embedded": {
"p50_seconds": null,
"p95_seconds": null,
@@ -7053,6 +7150,10 @@
"window_hours": 24
},
{
+ "behind": {
+ "commits": 0,
+ "oldest_seconds": null
+ },
"commit_to_embedded": {
"p50_seconds": null,
"p95_seconds": null,
@@ -7070,6 +7171,7 @@
"window_hours": 24
},
{
+ "behind": null,
"commit_to_embedded": {
"p50_seconds": null,
"p95_seconds": null,
diff --git a/test/fixtures/goldens/exports/types.json b/test/fixtures/goldens/exports/types.json
index de6eb6e6a5..d1a9928ccb 100644
--- a/test/fixtures/goldens/exports/types.json
+++ b/test/fixtures/goldens/exports/types.json
@@ -148,7 +148,7 @@
"listChunklessPagesWithContent: (opts?: { batchSize?: number; afterPageId?: number; sourceId?: string; }) => Promise<ChunklessPageRow[]>",
"listConfigKeys: (prefix: string) => Promise<string[]>",
"listCorpusSample: (opts: CorpusSampleOpts) => Promise<DomainBankRow[]>",
- "listEmbeddingStateRows: (opts: { sourceIds?: string[]; states: readonly EmbeddingState[]; limit: number; purgeWindowHours: number; }) => Promise<EmbeddingStateRow[]>",
+ "listEmbeddingStateRows: (opts: { sourceIds?: string[]; slugs?: string[]; states: readonly EmbeddingState[]; limit: number; purgeWindowHours: number; }) => Promise<EmbeddingStateRow[]>",
"listEnrichCandidates: (opts: EnrichCandidatesOpts) => Promise<EnrichCandidate[]>",
"listEvalCandidates: (filter?: { since?: Date; limit?: number; tool?: \"query\" | \"search\"; }) => Promise<EvalCandidate[]>",
"listEvalCaptureFailures: (filter?: { since?: Date; }) => Promise<EvalCaptureFailure[]>",
@@ -1150,7 +1150,7 @@
"listChunklessPagesWithContent: (opts?: { batchSize?: number; afterPageId?: number; sourceId?: string; }) => Promise<ChunklessPageRow[]>",
"listConfigKeys: (prefix: string) => Promise<string[]>",
"listCorpusSample: (opts: CorpusSampleOpts) => Promise<DomainBankRow[]>",
- "listEmbeddingStateRows: (opts: { sourceIds?: string[]; states: readonly EmbeddingState[]; limit: number; purgeWindowHours: number; }) => Promise<EmbeddingStateRow[]>",
+ "listEmbeddingStateRows: (opts: { sourceIds?: string[]; slugs?: string[]; states: readonly EmbeddingState[]; limit: number; purgeWindowHours: number; }) => Promise<EmbeddingStateRow[]>",
"listEnrichCandidates: (opts: EnrichCandidatesOpts) => Promise<EnrichCandidate[]>",
"listEvalCandidates: (filter?: { since?: Date; limit?: number; tool?: \"query\" | \"search\"; }) => Promise<EvalCandidate[]>",
"listEvalCaptureFailures: (filter?: { since?: Date; }) => Promise<EvalCaptureFailure[]>",
@@ -3446,7 +3446,7 @@
"listChunklessPagesWithContent: (opts?: { batchSize?: number; afterPageId?: number; sourceId?: string; }) => Promise<ChunklessPageRow[]>",
"listConfigKeys: (prefix: string) => Promise<string[]>",
"listCorpusSample: (opts: CorpusSampleOpts) => Promise<DomainBankRow[]>",
- "listEmbeddingStateRows: (opts: { sourceIds?: string[]; states: readonly EmbeddingState[]; limit: number; purgeWindowHours: number; }) => Promise<EmbeddingStateRow[]>",
+ "listEmbeddingStateRows: (opts: { sourceIds?: string[]; slugs?: string[]; states: readonly EmbeddingState[]; limit: number; purgeWindowHours: number; }) => Promise<EmbeddingStateRow[]>",
"listEnrichCandidates: (opts: EnrichCandidatesOpts) => Promise<EnrichCandidate[]>",
"listEvalCandidates: (filter?: { since?: Date; limit?: number; tool?: \"query\" | \"search\"; }) => Promise<EvalCandidate[]>",
"listEvalCaptureFailures: (filter?: { since?: Date; }) => Promise<EvalCaptureFailure[]>",
@@ -4564,7 +4564,7 @@
"kind": "function",
"name": "walkMarkdownFiles",
"signature": [
- "(dir: string) => { path: string; relPath: string; }[]"
+ "(dir: string, metafilePages?: MetafilePagesMode) => { path: string; relPath: string; }[]"
]
},
{
@@ -6726,7 +6726,7 @@
"listChunklessPagesWithContent: (opts?: { batchSize?: number; afterPageId?: number; sourceId?: string; }) => Promise<ChunklessPageRow[]>",
"listConfigKeys: (prefix: string) => Promise<string[]>",
"listCorpusSample: (opts: CorpusSampleOpts) => Promise<DomainBankRow[]>",
- "listEmbeddingStateRows: (opts: { sourceIds?: string[]; states: readonly EmbeddingState[]; limit: number; purgeWindowHours: number; }) => Promise<EmbeddingStateRow[]>",
+ "listEmbeddingStateRows: (opts: { sourceIds?: string[]; slugs?: string[]; states: readonly EmbeddingState[]; limit: number; purgeWindowHours: number; }) => Promise<EmbeddingStateRow[]>",
"listEnrichCandidates: (opts: EnrichCandidatesOpts) => Promise<EnrichCandidate[]>",
"listEvalCandidates: (filter?: { since?: Date; limit?: number; tool?: \"query\" | \"search\"; }) => Promise<EvalCandidate[]>",
"listEvalCaptureFailures: (filter?: { since?: Date; }) => Promise<EvalCaptureFailure[]>",
diff --git a/test/operations-coverage-ledger.test.ts b/test/operations-coverage-ledger.test.ts
index 4ea1e697f7..c6f5c2b0bd 100644
--- a/test/operations-coverage-ledger.test.ts
+++ b/test/operations-coverage-ledger.test.ts
@@ -140,6 +140,7 @@ const LEDGER: Record<string, string> = {
sources_list: 'test/sources-mcp.test.ts',
sources_remove: 'test/sources-mcp.test.ts',
sources_status: 'test/sources-mcp.test.ts',
+ sources_resolve_path: 'test/sources-resolve-path.test.ts',
request_tools: 'test/request-tools.test.ts',
get_recent_salience: 'test/salience-source-scope.test.ts',
find_anomalies: 'test/salience-source-scope.test.ts',
diff --git a/test/operations-source-isolation-matrix.test.ts b/test/operations-source-isolation-matrix.test.ts
index 3a1056d1e7..f40dddb4aa 100644
--- a/test/operations-source-isolation-matrix.test.ts
+++ b/test/operations-source-isolation-matrix.test.ts
@@ -205,6 +205,7 @@ const MATRIX: Row[] = [
expectScoped: () => {
throw new Error('sources_status must fail closed (not_found) for out-of-scope ids under any untrusted ctx');
} },
+ { name: 'sources_resolve_path', mode: 'skip', reason: 'needs a Git checkout of the source; the not_found confinement of an out-of-scope id (assertSourceInCallerScope, as sources_status) is pinned in test/sources-resolve-path.test.ts' },
{ name: 'schema_stats', mode: 'isolated', args: {} },
{ name: 'schema_review_orphans', mode: 'isolated', args: { limit: 50 } },
diff --git a/test/remote-privacy-sweep.test.ts b/test/remote-privacy-sweep.test.ts
index b6127c415e..9c25d0093c 100644
--- a/test/remote-privacy-sweep.test.ts
+++ b/test/remote-privacy-sweep.test.ts
@@ -186,6 +186,7 @@ const PARAM_FACTORY: Record<string, Record<string, unknown>> = {
find_contradictions: {},
search_by_image: {},
sources_status: { id: 'default' },
+ sources_resolve_path: { id: 'default', paths: ['notes/sweep-example.md'] },
ontology_get: { entity: WORLD_PAGE_SLUG },
get_skill: { name: 'query' },
// Mutating ops target FRESH slugs only — never the seeded corpus. The
@@ -273,6 +274,7 @@ const EXPECTED_OUTCOME: Record<string, Outcome> = {
whoami: 'ok', // base unused — per-shape override in EXPECTED_BY_SHAPE (above)
sources_list: 'ok',
sources_status: 'ok',
+ sources_resolve_path: 'error',
find_orphans: 'ok',
wanted_pages: 'ok',
find_contradictions: 'ok',
diff --git a/test/retrieval-op-redaction.test.ts b/test/retrieval-op-redaction.test.ts
index 3090044b42..9d39de76c6 100644
--- a/test/retrieval-op-redaction.test.ts
+++ b/test/retrieval-op-redaction.test.ts
@@ -197,6 +197,7 @@ const SWEEP: Record<string, Row> = {
whoami: { args: {} },
sources_list: { args: {} },
sources_status: { args: { id: SRC } },
+ sources_resolve_path: { skip: 'needs a Git checkout of the source; returns paths, slugs, states and counts, never page text; test/sources-resolve-path.test.ts owns it' },
sources_inspect: { skip: 'local-only inspection of a committed Git repository directory; returns repo metadata, owned by the sources suites' },
request_tools: { args: { tools: ['get_page'] } },
connectors_status: { args: {}, remote: false },
diff --git a/test/sources-resolve-path.test.ts b/test/sources-resolve-path.test.ts
index 334b224006..43ff36e570 100644
--- a/test/sources-resolve-path.test.ts
+++ b/test/sources-resolve-path.test.ts
@@ -152,6 +152,8 @@ test('the operation is read-scoped, takes paths relative to the source root, and
expect(op).toMatchObject({ scope: 'read', mutating: false });
const out = await op.handler({ engine, remote: false } as never, { id: s.id, paths: ['./notes/a.md'] }) as Awaited<ReturnType<typeof resolveSourcePaths>>;
expect(out.paths[0]).toMatchObject({ slug: 'notes/a', in_synced_commit: true });
+ const remote = { engine, remote: true, sourceId: 'other-example', auth: { allowedSources: ['other-example'] } } as never;
+ await expect(op.handler(remote, { id: s.id, paths: ['notes/a.md'] })).rejects.toMatchObject({ code: 'not_found' });
await expect(s.resolve()).rejects.toMatchObject({ code: 'invalid_params' });
await expect(s.resolve(...Array.from({ length: RESOLVE_PATHS_MAX + 1 }, (_, i) => `notes/${i}.md`))).rejects.toMatchObject({ code: 'invalid_params' });
}), 240_000);