@littlebigbrain/client 0.7.0 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @littlebigbrain/client
2
2
 
3
- The typed TypeScript client for [Little Big Brain](https://littlebigbrain.com) — write graph facts, build indexes, and run hybrid search over one snapshot. Request and response types are generated from the API contract, so every call is fully typed. Runs anywhere there's a global `fetch`: Node 18+, browsers, and edge workers.
3
+ The typed TypeScript client for [Little Big Brain](https://littlebigbrain.com) — write graph facts and query one immutable published snapshot. Request and response types are generated from the API contract, so every call is fully typed. Runs anywhere there's a global `fetch`: Node 18+, browsers, and edge workers.
4
4
 
5
5
  ```sh
6
6
  npm install @littlebigbrain/client
@@ -32,13 +32,14 @@ await graph.facts.create(
32
32
  { idempotencyKey: "policy-42-v1" },
33
33
  );
34
34
 
35
- // 2. Build persisted BM25 + vector + adjacency indexes and wait.
36
- await graph.indexes.run({ wait: true });
35
+ // 2. Publication is automatic. Inspect one coherent watermark when needed.
36
+ const published = await lbb.readSnapshot();
37
+ console.log(published.snapshot.served_at_seq, published.query_lag_commits);
37
38
 
38
39
  // 3. Hybrid search over the snapshot.
39
40
  const results = await graph.search.hybrid(
40
41
  "How long are customer records retained?",
41
- { topK: 10, source: "persisted", consistency: "strong" },
42
+ { topK: 10, consistency: "eventual" },
42
43
  );
43
44
  ```
44
45
 
@@ -97,7 +98,12 @@ Methods return parsed JSON and throw `LbbError` (with `status`, `code`, `message
97
98
 
98
99
  ## More
99
100
 
100
- The `graph(...)` scope exposes `facts`, `search`, `entities`, `indexes`, `ontology`, `query`, `schema`, and `context` namespaces — covering managed embeddings, multi-query fusion, traversal, temporal state and history, SHACL, ontology evolution, and durable index jobs. Every generated shape is available as `Schemas["TypeName"]`.
101
+ The `graph(...)` scope exposes `facts`, `search`, `entities`, `ontology`,
102
+ `query`, `schema`, and `context` namespaces. `context` includes vocabulary
103
+ suggestion, term resolution, relation decoding, and groundability inspection; `schema`
104
+ reads or atomically publishes the active ontology/shapes bundle. Writes enqueue
105
+ published-generation maintenance automatically. Every generated shape is
106
+ available as `Schemas["TypeName"]`.
101
107
 
102
108
  Full reference and guides: [docs.littlebigbrain.com/sdks/typescript](https://docs.littlebigbrain.com/sdks/typescript/).
103
109
 
package/dist/client.d.ts CHANGED
@@ -1,12 +1,12 @@
1
- import type { ImportLine, LbbClientOptions, ListResponse, RawLbbResponse, RdfExportOptions, RdfImportOptions, Schemas, SparqlResults } from "./types.js";
1
+ import type { ImportLine, LbbClientOptions, ListResponse, RawLbbResponse, ReadConsistencyOptions, RdfImportOptions, Schemas, SearchConsistency, SparqlResults } from "./types.js";
2
2
  import { type CallOptions, type RequestOptions } from "./transport.js";
3
- import { ContextNamespace, EntityNamespace, GraphNamespace, IndexNamespace, OntologyNamespace, QueryNamespace, SchemaNamespace, SearchNamespace } from "./namespaces.js";
3
+ import { ContextNamespace, EntityNamespace, GraphNamespace, OntologyNamespace, QueryNamespace, SchemaNamespace, SearchNamespace } from "./namespaces.js";
4
4
  export { parseSparqlResults } from "./types.js";
5
- export type { AttributeFilter, AttributeFilterOp, AttributeFilterValue, EntityAttributeFilterOptions, EntityPropertiesLine, FetchLike, FlatProperties, ImportLine, LbbClientOptions, LbbRequestEvent, LbbResponseEvent, LbbRetryEvent, LbbErrorPayload, ListResponse, RawLbbResponse, RdfExportOptions, RdfImportOptions, Schemas, SparqlResults, SparqlResultsJson, SparqlTerm, AskRequest, AskResponse, CommitRequest, CommitResponse, Entity, EntitySelector, GraphMetadata, GraphSummary, SchemaView, SearchRequest, SearchResponse, SearchResult, Snapshot, } from "./types.js";
5
+ export type { AttributeFilter, AttributeFilterOp, AttributeFilterValue, EntityAttributeFilterOptions, EntityPropertiesLine, FetchLike, FlatProperties, ImportLine, LbbClientOptions, LbbRequestEvent, LbbResponseEvent, LbbRetryEvent, LbbErrorPayload, ListResponse, RawLbbResponse, ReadConsistencyOptions, RdfImportOptions, Schemas, SearchConsistency, SparqlResults, SparqlResultsJson, SparqlTerm, CommitRequest, CommitResponse, Entity, EntitySelector, GraphMetadata, GraphSummary, SchemaView, SearchRequest, SearchResponse, SearchResult, Snapshot, } from "./types.js";
6
6
  export { LbbError } from "./transport.js";
7
7
  export type { CallOptions, Query, QueryValue, RequestOptions, } from "./transport.js";
8
- export type { EntityListOptions, HybridSearchOptions } from "./namespaces.js";
9
- export { ContextNamespace, EntityNamespace, FactsNamespace, GraphNamespace, IndexNamespace, OntologyNamespace, QueryNamespace, SchemaNamespace, SearchNamespace, } from "./namespaces.js";
8
+ export type { HybridSearchOptions } from "./namespaces.js";
9
+ export { ContextNamespace, EntityNamespace, FactsNamespace, GraphNamespace, OntologyNamespace, QueryNamespace, SchemaNamespace, SearchNamespace, } from "./namespaces.js";
10
10
  export interface IndexLineageObservation {
11
11
  metadata: Schemas["GraphMetadataResponse"];
12
12
  lineage: Schemas["IndexLineage"];
@@ -36,9 +36,10 @@ export declare class LbbClient {
36
36
  private readonly onRequest?;
37
37
  private readonly onResponse?;
38
38
  private readonly onRetry?;
39
+ /** A5 default read consistency applied when a read omits its own value. */
40
+ readonly defaultConsistency?: SearchConsistency;
39
41
  readonly context: ContextNamespace;
40
42
  readonly search: SearchNamespace;
41
- readonly indexes: IndexNamespace;
42
43
  readonly entities: EntityNamespace;
43
44
  readonly schema: SchemaNamespace;
44
45
  readonly ontology: OntologyNamespace;
@@ -58,6 +59,17 @@ export declare class LbbClient {
58
59
  branch?: string;
59
60
  stack?: string;
60
61
  }): LbbClient;
62
+ /**
63
+ * A5: fold read-consistency options into a request body's own `consistency` /
64
+ * `min_indexed_seq` fields (the shape used by full-text, embedding, and
65
+ * structured-SPARQL bodies). A per-call value wins over the client
66
+ * `defaultConsistency`; an explicit body field wins over both.
67
+ */
68
+ resolveConsistency(opts?: ReadConsistencyOptions): SearchConsistency | undefined;
69
+ private mergeReadConsistency;
70
+ /** A5: read-consistency options rendered as URL query params, for the routes
71
+ * that carry consistency on the URL (SPARQL-text, graph summary). */
72
+ private readConsistencyQuery;
61
73
  private buildUrl;
62
74
  rawRequest<T>(method: string, path: string, opts?: RequestOptions): Promise<RawLbbResponse<T>>;
63
75
  request<T>(method: string, path: string, opts?: RequestOptions): Promise<T>;
@@ -66,7 +78,9 @@ export declare class LbbClient {
66
78
  /** Commit triplets and optional entity embeddings. Prefer `client.graph("main").facts.create(...)`. */
67
79
  commit(body: Schemas["TripletCommitFile"], opts?: {
68
80
  idempotencyKey?: string;
69
- }): Promise<Schemas["GraphCommitResponse"]>;
81
+ }): Promise<Schemas["GraphCommitResponse"] & {
82
+ commitSeq: number;
83
+ }>;
70
84
  /**
71
85
  * Validate-only preflight: run the same ontology/schema validation a real
72
86
  * commit would and report the would-be effect (`op_count`, `written_properties`,
@@ -82,28 +96,25 @@ export declare class LbbClient {
82
96
  * streamed request without a single oversized commit. Pass `lines` as an array
83
97
  * (serialized to NDJSON here) or a pre-built NDJSON string.
84
98
  *
85
- * Set `index: true` to run one full index build after the last batch, so the
86
- * data is served from the persisted runs (not just the ephemeral snapshot
87
- * fallback) by the time the call returns — the "bulk load, queryable on return"
88
- * path. Prefer this over indexing per batch (which serializes builds and races
89
- * the throttle): import the whole dataset, index once. The response's `index`
90
- * object reports whether the build ran or was skipped.
99
+ * A successful import durably enqueues one complete published-generation
100
+ * build after the final batch. It does not build index families or wait for
101
+ * visibility; the response's `published_generation` object carries the
102
+ * durable job and due sequence to observe.
91
103
  */
92
104
  import(lines: ImportLine[] | string, opts?: {
93
105
  batch?: number;
94
106
  strict?: boolean;
95
107
  observedAt?: string;
96
- index?: boolean;
97
108
  idempotencyKey?: string;
98
- }): Promise<Schemas["GraphImportResponse"]>;
109
+ }): Promise<Schemas["GraphImportResponse"] & {
110
+ commitSeq: number | null;
111
+ }>;
99
112
  /**
100
113
  * Bulk-ingest N-Triples, Turtle, N-Quads, or TriG without client-side conversion. Resource-object
101
114
  * triples become keyed Resource edges; literal-object triples become text
102
115
  * properties on the subject Resource.
103
116
  */
104
117
  importRdf(rdf: string, opts?: RdfImportOptions): Promise<Schemas["GraphRdfImportResponse"]>;
105
- /** Export the snapshot-visible RDF projection as Turtle, N-Triples, TriG, or N-Quads. */
106
- exportRdf(opts?: RdfExportOptions): Promise<string>;
107
118
  /**
108
119
  * Retract specific edges and/or every edge touching given entities. Appends
109
120
  * superseding retract events rather than deleting — history stays visible in an
@@ -256,19 +267,15 @@ export declare class LbbClient {
256
267
  kind: string;
257
268
  run: number;
258
269
  }): Promise<Schemas["ModelSplitAudit"]>;
259
- /**
260
- * Champion vs challenger retrieval over one pinned snapshot. Returns
261
- * promotion evidence (hit-rate@k, latency, overlap); never promotes.
262
- */
263
- shadowEval(body: Schemas["ShadowEvalRequest"]): Promise<Schemas["ShadowEvalResponse"]>;
264
- /**
265
- * Execution-verified QA probes generated from the graph's current edges —
266
- * labels are the executed projections, so they are verified by construction.
267
- * Feeds `shadowEval` directly.
268
- */
270
+ /** Execution-verified QA probes generated from the graph's current edges. */
269
271
  syntheticEval(opts?: {
270
272
  limit?: number;
271
273
  }): Promise<Schemas["SyntheticEvalResponse"]>;
274
+ /**
275
+ * Compare champion and challenger retrieval over one pinned published
276
+ * snapshot. The endpoint returns promotion evidence but never promotes.
277
+ */
278
+ shadowEval(body: Schemas["ShadowEvalRequest"]): Promise<Schemas["ShadowEvalResponse"]>;
272
279
  /** The doubling retrain policy: is a retrain due for this model kind? */
273
280
  modelCadence(opts: {
274
281
  kind: string;
@@ -286,15 +293,6 @@ export declare class LbbClient {
286
293
  trainingConfig(): Promise<Schemas["ModelTrainingConfig"]>;
287
294
  /** Set the automatic-training configuration (`auto_train` toggle + kinds). */
288
295
  setTrainingConfig(body: Schemas["ModelTrainingConfig"]): Promise<Schemas["ModelTrainingConfig"]>;
289
- /**
290
- * Verdict on an ask (`accepted` | `rejected` | `corrected` + the right
291
- * plan), joined to the ask's trace by `ask_id` — the planner fine-tune's
292
- * explicit feedback capture. `accepted: false` in the response means
293
- * signal capture is off on this deployment (the contract is identical).
294
- */
295
- askFeedback(body: Schemas["AskFeedbackRequest"], opts?: {
296
- idempotencyKey?: string;
297
- }): Promise<Schemas["AskFeedbackResponse"]>;
298
296
  ingestSignals(body: Schemas["SignalIngestRequest"], opts?: {
299
297
  idempotencyKey?: string;
300
298
  }): Promise<Schemas["SignalIngestResponse"]>;
@@ -307,36 +305,22 @@ export declare class LbbClient {
307
305
  externalPlannerTrace(payload: Schemas["ExternalPlannerTraceV1"], opts?: {
308
306
  idempotencyKey?: string;
309
307
  }): Promise<Schemas["SignalIngestResponse"]>;
310
- /**
311
- * The planner fine-tune's training feed: accepted/corrected feedback
312
- * joined to its traces (signals ≤ the split pin), topped up with
313
- * execution-verified synthetic plans.
314
- */
308
+ /** Planner training examples at or before an optional signal split. */
315
309
  plannerDataset(opts?: {
316
310
  limit?: number;
317
311
  splitSeq?: number;
318
312
  }): Promise<Schemas["PlannerDatasetResponse"]>;
319
- /**
320
- * The DPO pass's training feed: preference pairs from corrected verdicts,
321
- * paired rejections, and synthetic corrupted-slot pairs.
322
- */
313
+ /** Planner preference pairs at or before an optional signal split. */
323
314
  plannerPreferenceDataset(opts?: {
324
315
  limit?: number;
325
316
  splitSeq?: number;
326
317
  }): Promise<Schemas["PlannerPreferenceDatasetResponse"]>;
327
- /**
328
- * The suggest-ranker trainer's probe feed: `suggestion_adopted` signals
329
- * (typed prefix + adopted text) ≤ the split pin, topped up with
330
- * execution-verified synthetic vocabulary pairs.
331
- */
318
+ /** Suggest-ranker examples at or before an optional signal split. */
332
319
  suggestDataset(opts?: {
333
320
  limit?: number;
334
321
  splitSeq?: number;
335
322
  }): Promise<Schemas["SuggestDatasetResponse"]>;
336
- /**
337
- * The extractor fine-tune's training feed: EPISODE transcripts joined to
338
- * the facts the observe pipeline committed from them.
339
- */
323
+ /** Extractor examples at or before an optional signal split. */
340
324
  extractorDataset(opts?: {
341
325
  limit?: number;
342
326
  splitSeq?: number;
@@ -352,15 +336,14 @@ export declare class LbbClient {
352
336
  }): Promise<unknown>;
353
337
  /**
354
338
  * Promote a finished `planner_lora` training run: gated on held-out slot
355
- * exactness, recorded as a `kind=planner` training run whose adapter `/v1/ask`
356
- * then serves.
339
+ * exactness and recorded as a `kind=planner` training run.
357
340
  */
358
341
  promotePlanner(opts: {
359
342
  runId: string;
360
343
  allowRegression?: boolean;
361
344
  }): Promise<unknown>;
362
345
  /** Full semantic hybrid search from a request body (`POST /v1/graph/search`). */
363
- graphSearch(body: Schemas["SemanticGraphSearchRequest"]): Promise<Schemas["SemanticGraphSearchResponse"]>;
346
+ graphSearch(body: Schemas["SemanticGraphSearchRequest"], opts?: ReadConsistencyOptions): Promise<Schemas["SemanticGraphSearchResponse"]>;
364
347
  /** Reciprocal-rank-fusion across sub-queries. */
365
348
  multiSearch(body: Schemas["HybridMultiSearchRequest"]): Promise<Schemas["HybridMultiSearchResponse"]>;
366
349
  /**
@@ -369,28 +352,11 @@ export declare class LbbClient {
369
352
  * pair that admits a single relation flags `signature_forced`.
370
353
  */
371
354
  suggest(body: Schemas["SearchSuggestRequest"]): Promise<Schemas["SearchSuggestResponse"]>;
372
- /**
373
- * Snap free text to the nearest real vocabulary item. Embedding cosine
374
- * on a managed graph, else lexical; never fabricates a term.
375
- */
355
+ /** Snap free text to the nearest term in the pinned published vocabulary. */
376
356
  resolveTerm(body: Schemas["ResolveTermRequest"]): Promise<Schemas["ResolveTermResponse"]>;
377
- /**
378
- * Ground a natural-language question to the graph's real vocabulary, retrieve
379
- * against the pinned snapshot, and answer with citations (`/v1/ask`).
380
- */
381
- ask(body: Schemas["AskRequest"]): Promise<Schemas["AskResponse"]>;
382
- /**
383
- * Name the relation between two entities (`/v1/decode`): the DB narrows the
384
- * candidates to the type pair's admissible relations, answers alone
385
- * when the pair forces a single relation, and otherwise decodes it with the
386
- * graph-native fine-tuned model — the "DB narrows, cheap model decodes" call.
387
- */
357
+ /** Decode a relation from the graph's admissible published vocabulary. */
388
358
  decode(body: Schemas["DecodeRequest"]): Promise<Schemas["DecodeResponse"]>;
389
- /**
390
- * Report which completion mechanisms will carry on this graph:
391
- * signature sparsity, name semantics, sampled narrowing recall, and a
392
- * narrow / narrow+finetune / lexical-first recommendation.
393
- */
359
+ /** Report completion strategy fitness for the pinned published graph. */
394
360
  groundability(opts?: {
395
361
  sample?: number;
396
362
  }): Promise<Schemas["GroundabilityReport"]>;
@@ -407,9 +373,9 @@ export declare class LbbClient {
407
373
  /** Export the stored relevance labels as qrels-style rows for training. */
408
374
  searchFeedbackExport(): Promise<Schemas["SearchFeedbackExportResponse"]>;
409
375
  /** BM25 search. */
410
- fullTextSearch(body: Schemas["FullTextSearchRequest"]): Promise<Schemas["FullTextSearchResponse"]>;
376
+ fullTextSearch(body: Schemas["FullTextSearchRequest"], opts?: ReadConsistencyOptions): Promise<Schemas["FullTextSearchResponse"]>;
411
377
  /** ANN/vector search. */
412
- embeddingSearch(body: Schemas["EmbeddingSearchRequest"]): Promise<Schemas["EmbeddingSearchResponse"]>;
378
+ embeddingSearch(body: Schemas["EmbeddingSearchRequest"], opts?: ReadConsistencyOptions): Promise<Schemas["EmbeddingSearchResponse"]>;
413
379
  /** Bounded k-hop graph traversal. */
414
380
  traverse(body: Schemas["TraverseRequest"]): Promise<Schemas["TraverseResponse"]>;
415
381
  /** Resolve a query to seed entities, then return bounded paths. */
@@ -421,8 +387,6 @@ export declare class LbbClient {
421
387
  name?: string;
422
388
  relations?: string[];
423
389
  asOf?: string;
424
- /** Require the bounded ranged-adjacency path; returns `index_busy` while unavailable. */
425
- indexed?: boolean;
426
390
  }): Promise<Schemas["EntityNeighborhoodResponse"]>;
427
391
  /** Exact type cardinality plus a bounded deterministic sample from ranged adjacency. */
428
392
  entityTypeSample(opts: {
@@ -449,37 +413,11 @@ export declare class LbbClient {
449
413
  asOf?: string;
450
414
  asOfCommitSeq?: number;
451
415
  }): Promise<Schemas["EntityDetailResponse"]>;
452
- /**
453
- * Paged edge listing. Scope to one node with `id` (or `type`+`name`) and a
454
- * `direction` (`out`/`in`/`both`) to walk **every** edge of a high-degree node
455
- * — `entityDetail` returns the full set but is awkward to page; this carries
456
- * `offset`/`limit` and reports `total_count`. Optional `relation`/`q` filters
457
- * and an `asOf`/`asOfCommitSeq` snapshot pin. Each row carries `valid_time`, so
458
- * the page is enough to reconstruct a per-edge timeline.
459
- */
460
- graphEdges(opts?: {
461
- id?: string;
462
- type?: string;
463
- name?: string;
464
- direction?: "out" | "in" | "both";
465
- relation?: string;
466
- q?: string;
467
- limit?: number;
468
- /** Opaque cursor from a previous page's `next_cursor`. */
469
- cursor?: string | number;
470
- /** @deprecated Legacy alias for `cursor` (still accepted by the server). */
471
- offset?: number;
472
- asOf?: string;
473
- asOfCommitSeq?: number;
474
- }): Promise<ListResponse<Schemas["GraphEdgeRow"]>>;
475
416
  /**
476
417
  * Page through every row of a list endpoint, following `next_cursor` until
477
418
  * exhausted. Pass a fetcher that takes a cursor and returns a
478
419
  * {@link ListResponse}:
479
- * ```ts
480
- * for await (const e of client.listAll((cursor) =>
481
- * client.entities.list({ cursor, fields: "title" }))) { … }
482
- * ```
420
+ * The caller supplies a bounded collection endpoint and its cursor.
483
421
  */
484
422
  listAll<T>(fetchPage: (cursor?: string) => Promise<ListResponse<T>>): AsyncGenerator<T, void, unknown>;
485
423
  /** Current state of an entity's relations, optionally as-of a timestamp. */
@@ -490,8 +428,6 @@ export declare class LbbClient {
490
428
  transitions(body: Schemas["EntityTransitionsRequest"]): Promise<Schemas["EntityTransitionsResponse"]>;
491
429
  /** Lineage and evidence for a single edge. */
492
430
  why(body: Schemas["WhyRequest"]): Promise<Schemas["WhyResponse"]>;
493
- /** SHACL-style shape/pattern query. */
494
- shacl(body: Schemas["ShaclQueryRequest"]): Promise<Schemas["ShaclQueryResponse"]>;
495
431
  /**
496
432
  * SPARQL-subset SELECT/ASK/aggregate query (FILTER, HAVING, ORDER BY, ASK,
497
433
  * COUNT/SUM/AVG/MIN/MAX). GROUP BY is not limited to entity identity:
@@ -502,9 +438,9 @@ export declare class LbbClient {
502
438
  * keys come back per group in `groups[].value_keys[<as>]`, entity keys in
503
439
  * `groups[].keys`.
504
440
  */
505
- sparql(body: Schemas["SparqlSelectRequest"]): Promise<Schemas["SparqlSelectResponse"]>;
506
- /** SPARQL 1.1 query from text (SELECT/ASK) over the live graph; `results` is SPARQL 1.1 Query Results JSON. */
507
- sparqlText(body: Schemas["SparqlTextRequest"]): Promise<Schemas["SparqlTextResponse"]>;
441
+ sparql(body: Schemas["SparqlSelectRequest"], opts?: ReadConsistencyOptions): Promise<Schemas["SparqlSelectResponse"]>;
442
+ /** SPARQL 1.1 query from text (SELECT/ASK) over the live graph; `results` is SPARQL 1.1 Query Results JSON. The text dialect carries `consistency`/`min_indexed_seq` on the URL. */
443
+ sparqlText(body: Schemas["SparqlTextRequest"], opts?: ReadConsistencyOptions): Promise<Schemas["SparqlTextResponse"]>;
508
444
  /**
509
445
  * Run a SPARQL 1.1 text query and return parsed results — the ergonomic
510
446
  * complement to {@link sparqlText} (which hands back the raw results string).
@@ -512,7 +448,7 @@ export declare class LbbClient {
512
448
  * `rows` is the bindings flattened to `{ variable: lexicalValue }`, `boolean`
513
449
  * is the ASK answer (or `null` for a SELECT).
514
450
  */
515
- sparqlRows(body: Schemas["SparqlTextRequest"]): Promise<SparqlResults>;
451
+ sparqlRows(body: Schemas["SparqlTextRequest"], opts?: ReadConsistencyOptions): Promise<SparqlResults>;
516
452
  /**
517
453
  * Basic-graph-pattern query with group-graph-pattern combinators
518
454
  * (UNION / OPTIONAL / MINUS / EXISTS / NOT EXISTS) folded over the base
@@ -521,28 +457,6 @@ export declare class LbbClient {
521
457
  * optional/union/negated leg rather than a grouped aggregate.
522
458
  */
523
459
  analytics(body: Schemas["AnalyticQueryRequest"]): Promise<Schemas["AnalyticQueryResponse"]>;
524
- /**
525
- * Run inference rules (SHACL-AF `sh:TripleRule` shape) to a bounded fixpoint
526
- * and return the derived edges as a **preview** — derived facts are never
527
- * written to the asserted graph. Each rule is a BGP `body`/`where` plus a
528
- * `head` triple template instantiated per binding.
529
- */
530
- infer(body: Schemas["InferenceRunRequest"]): Promise<Schemas["InferenceRunResponse"]>;
531
- /**
532
- * Define (replace) the versioned rule set stored on the scoped graph branch.
533
- * The stored set is what SHACL `include_derived` and `infer` use when a
534
- * request carries no inline rules. Returns the new `rules_version`.
535
- */
536
- defineRules(body: Schemas["RuleSetDefineRequest"]): Promise<Schemas["RuleSetDefineResponse"]>;
537
- /** The rule set stored on the scoped graph branch (version + rules). */
538
- graphRules(): Promise<Schemas["RuleSet"]>;
539
- /**
540
- * Derive edges from calibrated retrieval matches (preview): each
541
- * candidate scored `P >= threshold` becomes a derived edge `(anchor, relation,
542
- * matched)` with a typed `Retrieval` provenance leaf. Pass either explicit
543
- * `candidates` or a `query` the server runs as BM25 entity retrieval.
544
- */
545
- retrievalPremises(body: Schemas["RetrievalPremiseRequest"]): Promise<Schemas["RetrievalPremiseResponse"]>;
546
460
  /**
547
461
  * The active ontology (entity types and relations) for the scoped graph.
548
462
  * Pass `{ counts: true }` to include a per-relation current-edge count
@@ -556,11 +470,10 @@ export declare class LbbClient {
556
470
  * Audit the current snapshot against the ontology's *implied* constraints —
557
471
  * capped `cardinality` derived as `sh:maxCount` — returning a SHACL-shaped
558
472
  * report. Whole-snapshot and never blocks a write. Unlike
559
- * {@link SchemaNamespace.audit}, this needs no published shape bundle: the
560
- * shapes come from the ontology itself. See the `decoration_status` catalog on
561
- * {@link ontologyView} for which decorations are enforced.
473
+ * The report is referenced by the pinned published read root and carries its
474
+ * own validation watermark and ontology/shapes provenance.
562
475
  */
563
- ontologyConformance(): Promise<Schemas["SchemaAuditReport"]>;
476
+ ontologyConformance(opts?: Pick<ReadConsistencyOptions, "consistency">): Promise<Schemas["SchemaAuditReport"]>;
564
477
  /** Discover ontology concepts, terms, and relations. */
565
478
  ontologySearch(body: Schemas["OntologySearchRequest"]): Promise<Schemas["OntologySearchResponse"]>;
566
479
  /** Resolve mentions to concepts/entities. */
@@ -576,47 +489,6 @@ export declare class LbbClient {
576
489
  evolveOntology(body: Schemas["OntologyEvolveRequest"]): Promise<Schemas["OntologyEvolveResponse"]>;
577
490
  /** Suggest ontology additions from the current graph without mutating it. */
578
491
  induceOntology(body: Schemas["OntologyInduceRequest"]): Promise<Schemas["OntologyInduceResponse"]>;
579
- /**
580
- * Build default ANN + BM25 indexes. With `{ background: true }` the build
581
- * runs detached on the server and the call returns immediately — use it for
582
- * large corpora whose synchronous build would exceed a fronting gateway's
583
- * timeout (a 504), then poll `metadata()` for completion.
584
- */
585
- indexBuild(opts?: {
586
- background?: boolean;
587
- }): Promise<unknown>;
588
- /**
589
- * Build BM25, ANN/vector, and adjacency index families. With
590
- * `{ background: true }` the build runs detached on the server and the call
591
- * returns immediately — use it for large corpora whose synchronous build would
592
- * exceed a fronting gateway's timeout, then poll `metadata()` for completion.
593
- */
594
- indexRun(opts?: {
595
- background?: boolean;
596
- }): Promise<unknown>;
597
- /** Submit a durable full-index build. Requires a reconnect-safe idempotency key. */
598
- indexSubmit(body: Partial<Schemas["IndexBuildOptions"]> | undefined, opts: {
599
- idempotencyKey: string;
600
- }): Promise<Schemas["SearchIndexJobStatusResponse"]>;
601
- /** Poll a durable full-index build. */
602
- indexJob(jobId: string): Promise<Schemas["SearchIndexJobStatusResponse"]>;
603
- /** Cancel a durable full-index build. Repeated cancellation returns its current terminal status. */
604
- cancelIndexJob(jobId: string): Promise<Schemas["SearchIndexJobStatusResponse"]>;
605
- /** Append a BM25 delta segment for the unindexed WAL tail. */
606
- indexDelta(): Promise<Schemas["IndexDeltaResponse"]>;
607
- /** Preview or delete superseded persisted index runs. */
608
- indexGc(opts?: {
609
- keepRuns?: number;
610
- dryRun?: boolean;
611
- }): Promise<Schemas["IndexGcResponse"]>;
612
- /** Submit durable, cancellable index garbage collection. */
613
- indexGcSubmit(body: Schemas["IndexGcRequest"] | undefined, opts: {
614
- idempotencyKey: string;
615
- }): Promise<Schemas["IndexGcJobStatusResponse"]>;
616
- /** Poll exact planning/deletion progress for durable index garbage collection. */
617
- indexGcJob(jobId: string): Promise<Schemas["IndexGcJobStatusResponse"]>;
618
- /** Cancel durable index garbage collection. */
619
- cancelIndexGcJob(jobId: string): Promise<Schemas["IndexGcJobStatusResponse"]>;
620
492
  /** Fold the WAL tail into snapshot segments. */
621
493
  compact(opts?: {
622
494
  minTailCommits?: number;
@@ -624,18 +496,18 @@ export declare class LbbClient {
624
496
  }): Promise<Schemas["WalCompactResponse"]>;
625
497
  /** Server, graph, and persisted-index status. */
626
498
  status(): Promise<unknown>;
627
- /** Graph footprint, WAL tail, and index coverage. Exact object inventory is opt-in. */
499
+ /** Graph footprint, WAL tail, and published-index coverage. */
628
500
  metadata(opts?: {
629
- includeObjects?: boolean;
630
501
  includeIndexes?: boolean;
631
- includeTemporalCoverage?: boolean;
632
502
  }): Promise<Schemas["GraphMetadataResponse"]>;
633
503
  waitForIndexLineage(targetSeq: number, opts?: {
634
504
  timeoutMs?: number;
635
505
  pollIntervalMs?: number;
636
506
  }): Promise<IndexLineageObservation>;
637
- /** Graph counts and type/relation buckets. */
638
- summary(): Promise<Schemas["GraphSummaryResponse"]>;
507
+ /** Graph counts and type/relation buckets. Carries `consistency`/`min_indexed_seq` on the URL. */
508
+ summary(opts?: ReadConsistencyOptions): Promise<Schemas["GraphSummaryResponse"]>;
509
+ /** Pinned published read root and its query/conformance lag against one coherent head. */
510
+ readSnapshot(): Promise<Schemas["PublishedReadStatusResponse"]>;
639
511
  /** List the graphs (and branches) under the scoped tenant. */
640
512
  listGraphs(): Promise<Schemas["GraphListResponse"]>;
641
513
  }