Skip to content

Interface: TermListResponse

@kortexya/reasoninglayer


@kortexya/reasoninglayer / TermListResponse

Defined in: src/types/query.ts:203

A page of terms, with the size of the whole answer beside it.

Returned as-is by TermsClient.listTerms and QueryClient.findBySortPage. Read total to page, never count — and read note before you tell a user an empty page means an empty sort.

count: number

Defined in: src/types/query.ts:217

How many terms are on THIS page — always terms.length, never the size of the answer.

With no limit the two coincide, which is what made the old “Total count” doc look right. Measured against the live engine on 2026-09-18: a tenant holding 3 terms answered GET /api/v1/terms?limit=1&offset=2 with {"count":1,"total":3}. Paging off count stops the walk after one page; page off total.


optional note?: string

Defined in: src/types/query.ts:258

The engine explaining an answer a caller would otherwise misread — today, an EMPTY answer for a sort whose members exist only by derivation.

GET /api/v1/terms and POST /api/v1/query/by-sort neither chain nor persist conclusions: they report the conclusions the process currently HOLDS. For a rule-conclusion sort in a freshly started process that set is empty, so the honest count is 0 — and total: 0 off that route reads like an authoritative “this sort has no members”, which is false. note is the engine saying so, and naming the routes that materialise the conclusions.

So: when the page is empty, surface note instead of “no results”. It is never an error, and never a substitute for one — ignore it and the rows beside it are still correct.

Measured 2026-09-18. A tenant with sort widget, subsort premium_widget, one widget fact and the rule widget(name: ?N) → premium_widget(name: ?N): POST /api/v1/query/by-sort {"sort_name":"premium_widget"} answered {"terms":[],"count":0,"total":0,"note":"premium_widget is a rule conclusion sort: its members are derived. … An empty answer here does not mean the sort has no members."}. GET /api/v1/terms?sort_name=premium_widget answered the same note. Before the rule existed, the same empty query carried no note.


terms: TermDto[]

Defined in: src/types/query.ts:205

The terms on this page.


optional total?: number

Defined in: src/types/query.ts:230

How many terms the request matched BEFORE offset and limit — the size of the answer, and the number to page against.

A counted size, never a search bound. Absent on a route that does not page (the namespace listings), so a caller that must page should treat undefined as “the endpoint does not report it” and fall back to the short-page rule, which is what TermsClient.iterateTerms does.

⚠️ total: 0 is not proof of an empty sort. See note.