Releases: ewiger/hql
Releases · ewiger/hql
Release list
v0.1.0
The first release: a typed expression core, a vault of Markdown and
HyperMarkDown documents, pipelines over its cards, two named retrievals, and
graph traversal that records why each node is present.
Language
- A typed expression core — scalars, collection literals, lambdas, field access
and pipelines — checked before it is evaluated. typedeclarations parsed and checked, sostd/is read rather than assumed:
core,collections,doc,graph,knowledgeandretrieval.Scalaras a type,Dataas a union, and a collection vocabulary settled on
order: a sequence has one, a set does not, andtakeneeds elements that
carry their own.:as the subtype operator, replacing<:.- A collection literal evaluates at its checked element type, and an unrelated
tree is held asData. HitandRankingcarry the retrieval that produced them — query, index,
model, model revision, metric, and whether the search was approximate.
Retrieval and graph
lexical, which matches shared spellings offline with nothing to build.semantic, which scores against vectors computed ahead of time;
contrib/semantics/produces the index and the
binary only reads it.- Which model fills that index is the vault's choice.
[semantics.embedder]in
hql.tomldeclares one of two providers —local, a checkpoint in the
producer's own process, orhttp, an OpenAI-shaped/v1/embeddingsendpoint
covering a hosted provider and a model server onlocalhostalike — and every
buildflag overrides it field by field. A key is named as an environment
variable and never written into the committed file, andhttpneeds an
explicitrevision, because an endpoint offers nothing to derive the pin a
score claims. The producer gains no dependency:httpuses the standard
library, and indexing through one needs notorch. - Scoring checks the precondition it rests on. A dot product is cosine only for
unit-length vectors, so the producer normalises whatever an embedder returned,
the index refuses to be written holding a vector that is not unit-length, and
the reader refuses an index declaringnormalized = 0or a metric it does not
compute. Truncated embeddings are why this cannot be implicit: a prefix of a
unit vector is not a unit vector. expand, which traverses outwards and records the reason each node is
present, so a graph of matches and their neighbours does not claim that all of
them matched.- Links traverse as uplinks and downlinks.
The command line
eval,check,run,repl,render,builtinsandconfig.-reads
standard input wherever a file is taken.--format jsonemits the type, the value and the report queue for another
program.hql render --writeruns thehql#evalblocks in a document and writes each
answer beneath it as anhql#resultblock, replacing the previous one.- Reporting yields a value and a queue:
--report strictstops at the first
error and is the default,--report collectreports every error findable. The
mode comes from the query, then the vault'shql.toml, then$HQL_REPORT,
then the default. - Exit
0on success,1on a language or I/O failure,2on a usage error.
Diagnostics carry zero-based UTF-8 byte ranges and render with a line, a
column and a caret.
Extensions and execution
- An extension mechanism with declared contracts, and a checked execution tree
with structural step contracts. - MapReduce pipeline stages with pluggable execution backends.
Corpora
tests/fixtures/birds/: fifty-six encyclopedia articles with an embedding
index committed beside them.examples/birds/: linked HyperMarkDown cards with
runnable collection queries, including intentional errors for duplicate keys
and non-orderable sorted-map keys.