Skip to content

Interface: TermResponse

@kortexya/reasoninglayer


@kortexya/reasoninglayer / TermResponse

Defined in: src/types/terms.ts:151

Response wrapper for term CRUD operations.

Important: Term CRUD endpoints return TermResponse, NOT raw TermDto. The wrapper includes validation state, witness proofs, and residual witnesses that indicate whether the term satisfies its sort’s type constraints.

optional etag?: string

Defined in: src/types/terms.ts:184

The term’s content ETag, read from the ETag response header — the value to send back as ifMatch on a later update or delete.

Set by TermsClient.createTerm, TermsClient.getTerm and TermsClient.updateTerm whenever the engine sends the header, and absent whenever it does not. The engine sends none for:

  • an asOf read (a past state is not a representation If-Match can guard);
  • a rule’s CONCLUSION (it lives in the resident store alone, and a write onto it is refused with DerivedFactWriteError or RuleTermWriteError anyway);
  • a term answered straight from durable storage because the live store did not hold it.

A rule’s tag is not read here: getTerm(ruleId) answers 404 for a rule. The rule routes publish it — AddRuleResponse.etag, ReplaceRuleResponse.etag and the listing’s RuleEntryDto.etag.

Not part of the response body: other routes that answer a TermResponse never set it.


optional residualWitnesses?: ResidualWitnessDto[]

Defined in: src/types/terms.ts:159

Residuated witnesses awaiting more information.


optional state?: TermState

Defined in: src/types/terms.ts:155

Validation state of the term against its sort’s witnesses.


term: TermDto

Defined in: src/types/terms.ts:153

The underlying term data.


optional witnessProofs?: WitnessProofDto[]

Defined in: src/types/terms.ts:157

Proofs of satisfied type witnesses.