Skip to content

Interface: OsfqlResponse

@kortexya/reasoninglayer


@kortexya/reasoninglayer / OsfqlResponse

Defined in: src/types/osfql.ts:333

Response from OSFQL execution.

Contains the results of executing an OSFQL program, including variable bindings from MATCH queries, IDs of produced terms and defined sorts, and diagnostic messages from the execution pipeline.

bindings: Record<string, OsfqlValue>[]

Defined in: src/types/osfql.ts:384

Variable bindings from MATCH queries. Each entry represents one solution.


chainCompletions: OsfqlChainCompletion[]

Defined in: src/types/osfql.ts:360

The completion of every forward-chain run, in execution order: explicit CHAINs and the re-derivations that writes and PROVE ran, each labelled with its statement.

Empty means no chain ran; it proves nothing. A run with fixpointReached: false left a partial set of conclusions: for a write’s re-derivation, the conclusions the write left in the store are incomplete.


computationTimeMs: number

Defined in: src/types/osfql.ts:443

Milliseconds the engine spent running the program — its own solve time, without the network round trip.


optional definedSortIds?: string[]

Defined in: src/types/osfql.ts:431

Sort IDs produced by DEFINE statements.


diagnostics: string[]

Defined in: src/types/osfql.ts:434

Diagnostic messages from the execution pipeline.


optional fetched?: Record<string, OsfqlValue>[]

Defined in: src/types/osfql.ts:391

Nested documents produced by a FETCH clause: one map per match row, each fetched variable resolved to a nested Psi-term (OsfqlValue term, coreference inlined). Omitted when the program has no FETCH.


producedTermIds: string[]

Defined in: src/types/osfql.ts:406

The ids of the terms this program CREATED.

An INSERT or NEW endpoint, an UPSERT or UPSERT LINK endpoint that found no term to merge into, a link’s edge term, a DERIVE or CHAIN conclusion. A term that existed before the program is never here: a write into it is reported in updatedTermIds. A term the program created and then modified is here ONLY. The two lists are disjoint.

One exception: the read-only ROW SEARCH, ROW QUERY and COLLECTION QUERY statements list the terms they MATCHED here.


optional profile?: OsfqlProfile

Defined in: src/types/osfql.ts:373

Native observations, present only when the request set OsfqlRequest.profile. They do not certify proof completeness or later durable publication.


proveCompletions: OsfqlProveCompletion[]

Defined in: src/types/osfql.ts:366

The enumeration completeness of each PROVE, in execution order. Empty when the program ran no PROVE.


optional qualification?: OsfqlQualification

Defined in: src/types/osfql.ts:487

How far each MATCH, PROVE and CHAIN statement’s answer is established, and the release context it was read in.

Only an enumeration whose status is complete is the whole answer: an empty bounded or incomplete answer is not absence.

Absent when the program answered no query.


optional rowStatus?: OsfqlRowVerdict[]

Defined in: src/types/osfql.ts:348

The verdict of each binding row, parallel to bindings.

Present only when some row is not plainly true. unknown marks a row that binds a well-founded UNDEFINED conclusion, answered because the statement asked with INCLUDING UNDEFINED, never as true. Absent means every row is true.


solveCompletions: OsfqlSolveCompletion[]

Defined in: src/types/osfql.ts:335

Pending and bounded searches cannot establish infeasibility.


optional sortDelete?: DeleteSortResponse | null

Defined in: src/types/osfql.ts:461

What a DROP SORT removed, when the program dropped a sort.

The same body SortsClient.deleteSort answers: DROP SORT name [CASCADE TERMS] [ORPHAN RULES] [CASCADE DESCENDANTS] runs the same guarded, durable delete after the program, with its options as the terms: 'delete', rules: 'orphan' and descendants: 'delete' dispositions. Each option defaults to refuse.

A refused DROP SORT does not answer here: it throws an ApiError with the status of the REST delete and error_type: "refused". Read its refusal with sortDeleteRefusalOf.

Absent when the program dropped no sort.


optional sortReparent?: SortReparentReport | null

Defined in: src/types/osfql.ts:475

What an ALTER SORT <name> PARENTS (…) changed, when the program moved a sort.

The report SortsClient.reparentSort answers, without the moved sort. The move runs after the program. A refused move throws an ApiError with status 400 and error_type: "refused"; the message names the cause.

Absent when no sort moved.


statementCount: number

Defined in: src/types/osfql.ts:437

Number of statements executed.


success: boolean

Defined in: src/types/osfql.ts:337

Whether execution succeeded.


optional unknownFilterExclusions?: OsfqlUnknownFilterExclusions

Defined in: src/types/osfql.ts:381

Candidate rows that WHERE filters excluded because a comparison read an explicitly uninstantiated stored value, across the executed statements. Absent when no such exclusion happened. While it is present, an absence the program reports is not established.


updatedTermIds: string[]

Defined in: src/types/osfql.ts:428

The ids of the terms that existed BEFORE this program and that it modified in place.

An UPDATE / SET / REMOVE; an UPSERT that merged into an existing term through its @key; a designated link endpoint that gained the edge feature; the source an UNLINK or an edge-term DELETE removed the edge feature from; a referrer that RETRACT … DETACH or MATCH … DETACH DELETE rewrote. An exact-match UPSERT writes nothing and is in neither list; a term the same statement deleted is not listed.

Disjoint from producedTermIds, so the counts are direct: producedTermIds.length created and updatedTermIds.length updated. Do not subtract one list from the other.

Always present. [] means the program modified no existing term — a zero-match UPDATE answers [], so a non-empty list is how a caller knows an UPDATE matched anything.